Thread:Project:Support desk/Connect through socket is crashing MySQL server

I have recently been put in charge of my companies Wiki that they use for a knowledge base. It is way out of date MediaWiki 	1.16.1 (patched to enable page accessrestriction) PHP 	5.2.17 (apache2handler) (patched to enable page accessrestriction) MySQL 	5.1.58 (patched to enable page accessrestriction)

and so the first thing Im working on is updating to the latest version. Created a virtual machine, cloned the production machine onto the VM and Ive run into a bit of a problem that I just cant track down. Any help would be greatly appreciated.

I can read and write to the wikidb through PhpMyAdmin using the same socket and user that the wiki is trying to use. but whenever i try and navigate to the mediawiki page in my browser the MySQL server crashes (mysql status shows uptime revert to 0seconds, and logs show a restart) and the following is dumped into the browser:

MediaWiki internal error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred Query: COMMIT Function: Database::commit Error: 2002 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) (localhost) ' in /var/www/html/mediawiki/includes/db/Database.php:576 Stack trace:
 * 1) 0 /var/www/html/mediawiki/includes/db/Database.php(538): DatabaseBase->reportQueryError('Can't connect t...', 2002, 'COMMIT', 'Database::commi...', false)
 * 2) 1 /var/www/html/mediawiki/includes/db/Database.php(1969): DatabaseBase->query('COMMIT', 'Database::commi...')
 * 3) 2 /var/www/html/mediawiki/includes/BagOStuff.php(265): DatabaseBase->commit
 * 4) 3 /var/www/html/mediawiki/includes/MessageCache.php(241): SqlBagOStuff->get('wikidb:messages...')
 * 5) 4 /var/www/html/mediawiki/includes/MessageCache.php(588): MessageCache->load('en')
 * 6) 5 /var/www/html/mediawiki/includes/MessageCache.php(527): MessageCache->getMsgFromNamespace('Mainpage', 'en')
 * 7) 6 [internal function]: MessageCache->get('mainpage', true, true)
 * 8) 7 /var/www/html/mediawiki/includes/StubObject.php(58): call_user_func_array(Array, Array)
 * 9) 8 /var/www/html/mediawiki/includes/StubObject.php(76): StubObject->_call('get', Array)
 * 10) 9 /var/www/html/mediawiki/includes/GlobalFunctions.php(742): StubObject->__call('get', Array)
 * 11) 10 /var/www/html/mediawiki/includes/GlobalFunctions.php(742): StubObject->get('mainpage', true, true)
 * 12) 11 /var/www/html/mediawiki/includes/GlobalFunctions.php(707): wfMsgGetKey('mainpage', true, true, true)
 * 13) 12 /var/www/html/mediawiki/includes/GlobalFunctions.php(655): wfMsgReal('mainpage', Array, true, true)
 * 14) 13 /var/www/html/mediawiki/includes/Title.php(284): wfMsgForContent('mainpage')
 * 15) 14 /var/www/html/mediawiki/includes/Wiki.php(117): Title::newMainPage
 * 16) 15 /var/www/html/mediawiki/index.php(61): MediaWiki->checkInitialQueries(NULL, 'view')
 * 17) 16 {main}

Exception caught inside exception handler: exception 'DBConnectionError' with message 'DB connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) (localhost)' in /var/www/html/mediawiki/includes/db/Database.php:421 Stack trace:
 * 1) 0 /var/www/html/mediawiki/includes/db/LoadBalancer.php(685): DatabaseBase->reportConnectionError('Unknown error (...')
 * 2) 1 /var/www/html/mediawiki/includes/db/LoadBalancer.php(455): LoadBalancer->reportConnectionError(Object(DatabaseMysql))
 * 3) 2 /var/www/html/mediawiki/includes/GlobalFunctions.php(2973): LoadBalancer->getConnection(-1, Array, false)
 * 4) 3 /var/www/html/mediawiki/includes/LocalisationCache.php(760): wfGetDB(-1)
 * 5) 4 /var/www/html/mediawiki/includes/LocalisationCache.php(321): LCStore_DB->get('en', 'deps')
 * 6) 5 /var/www/html/mediawiki/includes/LocalisationCache.php(350): LocalisationCache->isExpired('en')
 * 7) 6 /var/www/html/mediawiki/includes/LocalisationCache.php(262): LocalisationCache->initLanguage('en')
 * 8) 7 /var/www/html/mediawiki/includes/LocalisationCache.php(205): LocalisationCache->loadItem('en', 'defaultUserOpti...')
 * 9) 8 /var/www/html/mediawiki/languages/Language.php(442): LocalisationCache->getItem('en', 'defaultUserOpti...')
 * 10) 9 /var/www/html/mediawiki/includes/User.php(1053): Language->getDefaultUserOptionOverrides
 * 11) 10 /var/www/html/mediawiki/includes/User.php(1975): User::getDefaultOptions
 * 12) 11 [internal function]: User->getOption('language')
 * 13) 12 /var/www/html/mediawiki/includes/StubObject.php(58): call_user_func_array(Array, Array)
 * 14) 13 /var/www/html/mediawiki/includes/StubObject.php(182): StubObject->_call('getOption', Array)
 * 15) 14 /var/www/html/mediawiki/includes/StubObject.php(150): StubUser->__call('getOption', Array)
 * 16) 15 /var/www/html/mediawiki/includes/StubObject.php(150): StubUser->getOption('language')
 * 17) 16 /var/www/html/mediawiki/includes/StubObject.php(103): StubUserLang->_newObject
 * 18) 17 /var/www/html/mediawiki/includes/StubObject.php(57): StubObject->_unstub('getCode', 5)
 * 19) 18 /var/www/html/mediawiki/includes/StubObject.php(145): StubObject->_call('getCode', Array)
 * 20) 19 /var/www/html/mediawiki/includes/GlobalFunctions.php(582): StubUserLang->__call('getCode', Array)
 * 21) 20 /var/www/html/mediawiki/includes/GlobalFunctions.php(582): StubUserLang->getCode
 * 22) 21 /var/www/html/mediawiki/includes/MessageCache.php(506): wfGetLangObj(false)
 * 23) 22 /var/www/html/mediawiki/includes/GlobalFunctions.php(742): MessageCache->get('databaseerror', true, false)
 * 24) 23 /var/www/html/mediawiki/includes/GlobalFunctions.php(707): wfMsgGetKey('databaseerror', true, false, true)
 * 25) 24 /var/www/html/mediawiki/includes/Exception.php(75): wfMsgReal('databaseerror', Array)
 * 26) 25 /var/www/html/mediawiki/includes/db/Database.php(2731): MWException->msg('databaseerror', 'Database error')
 * 27) 26 /var/www/html/mediawiki/includes/Exception.php(209): DBQueryError->getPageTitle
 * 28) 27 /var/www/html/mediawiki/includes/Exception.php(172): MWException->htmlHeader
 * 29) 28 /var/www/html/mediawiki/includes/Exception.php(191): MWException->reportHTML
 * 30) 29 /var/www/html/mediawiki/includes/Exception.php(289): MWException->report
 * 31) 30 /var/www/html/mediawiki/includes/Exception.php(348): wfReportException(Object(DBQueryError))
 * 32) 31 [internal function]: wfExceptionHandler(Object(DBQueryError))
 * 33) 32 {main}