MediaWiki internal error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred
Query: SELECT img_size,img_width,img_height,img_bits,img_media_type,img_major_mime,img_minor_mime,img_metadata,img_timestamp,img_sha1,img_user,img_user_text,img_description FROM `image` WHERE img_name = 'Ryan-and-Me-Coronation.jpg' LIMIT 1
Function: LocalFile::loadFromDB
Error: 2002 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (localhost)
' in /usr/share/mediawiki1.7/includes/db/Database.php:606
Stack trace:
#0 /usr/share/mediawiki1.7/includes/db/Database.php(561): Database->reportQueryError('Can't connect t...', 2002, 'SELECT img_siz...', 'LocalFile::load...', false)
#1 /usr/share/mediawiki1.7/includes/db/Database.php(969): Database->query('SELECT img_siz...', 'LocalFile::load...')
#2 /usr/share/mediawiki1.7/includes/db/Database.php(1045): Database->select('image', Array, Array, 'LocalFile::load...', Array, Array)
#3 /usr/share/mediawiki1.7/includes/filerepo/LocalFile.php(234): Database->selectRow('image', Array, Array, 'LocalFile::load...')
#4 /usr/share/mediawiki1.7/includes/filerepo/LocalFile.php(292): LocalFile->loadFromDB()
#5 /usr/share/mediawiki1.7/includes/filerepo/LocalFile.php(494): LocalFile->load()
#6 /usr/share/mediawiki1.7/includes/filerepo/FileRepo.php(96): LocalFile->exists()
#7 /usr/share/mediawiki1.7/includes/filerepo/RepoGroup.php(73): FileRepo->findFile(Object(Title), false, 0)
#8 /usr/share/mediawiki1.7/includes/GlobalFunctions.php(2576): RepoGroup->findFile(Object(Title), false, 0)
#9 /usr/share/mediawiki1.7/includes/parser/Parser.php(4499): wfFindFile(Object(Title), false)
#10 /usr/share/mediawiki1.7/includes/parser/Parser.php(1709): Parser->makeImage(Object(Title), '300px')
#11 /usr/share/mediawiki1.7/includes/parser/Parser.php(981): Parser->replaceInternalLinks('<div>?<table wi...')
#12 /usr/share/mediawiki1.7/includes/parser/Parser.php(317): Parser->internalParse('{{Populace?|pho...')
#13 /usr/share/mediawiki1.7/includes/OutputPage.php(405): Parser->parse('{{Populace?|pho...', Object(Title), Object(ParserOptions), true, true, 21242)
#14 /usr/share/mediawiki1.7/includes/OutputPage.php(391): OutputPage->addWikiTextTitle('{{Populace?|pho...', Object(Title), true, true)
#15 /usr/share/mediawiki1.7/includes/OutputPage.php(500): OutputPage->addWikiTextTitleTidy('{{Populace?|pho...', Object(Title), true)
#16 /usr/share/mediawiki1.7/includes/DifferenceEngine.php(313): OutputPage->addWikiTextTidy('{{Populace?|pho...')
#17 /usr/share/mediawiki1.7/includes/DifferenceEngine.php(271): DifferenceEngine->renderNewRevision()
#18 /usr/share/mediawiki1.7/includes/Article.php(729): DifferenceEngine->showDiffPage(false)
#19 /usr/share/mediawiki1.7/includes/Wiki.php(437): Article->view()
#20 /usr/share/mediawiki1.7/includes/Wiki.php(59): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#21 /var/lib/mediawiki1.7/index.php(93): MediaWiki->initialize(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
#22 {main}

Exception caught inside exception handler: exception 'DBUnexpectedError' with message 'Error in fetchObject(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (localhost)' in /usr/share/mediawiki1.7/includes/db/Database.php:735
Stack trace:
#0 /usr/share/mediawiki1.7/includes/db/Database.php(2620): Database->fetchObject(false)
#1 /usr/share/mediawiki1.7/includes/LinkBatch.php(98): ResultWrapper->fetchObject()
#2 /usr/share/mediawiki1.7/includes/LinkBatch.php(78): LinkBatch->addResultToCache(Object(LinkCache), Object(ResultWrapper))
#3 /usr/share/mediawiki1.7/includes/LinkBatch.php(68): LinkBatch->executeInto(Object(LinkCache))
#4 /usr/share/mediawiki1.7/includes/Skin.php(208): LinkBatch->execute()
#5 /usr/share/mediawiki1.7/includes/Skin.php(184): Skin->preloadExistence()
#6 /usr/share/mediawiki1.7/includes/SkinTemplate.php(106): Skin->initPage(Object(OutputPage))
#7 /usr/share/mediawiki1.7/skins/MonoBook.php(24): SkinTemplate->initPage(Object(OutputPage))
#8 /usr/share/mediawiki1.7/includes/SkinTemplate.php(151): SkinMonoBook->initPage(Object(OutputPage))
#9 /usr/share/mediawiki1.7/includes/OutputPage.php(821): SkinTemplate->outputPage(Object(OutputPage))
#10 /usr/share/mediawiki1.7/includes/Exception.php(150): OutputPage->output()
#11 /usr/share/mediawiki1.7/includes/Exception.php(174): MWException->reportHTML()
#12 /usr/share/mediawiki1.7/includes/Exception.php(260): MWException->report()
#13 /usr/share/mediawiki1.7/includes/Exception.php(294): wfReportException(Object(DBQueryError))
#14 [internal function]: wfExceptionHandler(Object(DBQueryError))
#15 {main}