Topic on Project:Support desk

Cannot access database error, upgrading from 1.19 to 1.33

2
Dajagr (talkcontribs)

I have been attempting to update a wiki from 1.19 on an older machine to 1.33 on a newer machine. (The newer machine is running a newer Fedora version, and so has newer MySQL and PHP, which requires me to update.)

I dumped the database from the old machine, transfered it to the new one, and imported it into MySQL. That seems to have gone correctly.

However, attempts to connect to the wiki after setting it up have resulted in errors:

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Cannot access the database)

#0 /var/www/html/wiki/WikiName/includes/libs/rdbms/loadbalancer/LoadBalancer.php(758): Wikimedia\Rdbms\LoadBalancer->reportConnectionError()

#1 /var/www/html/wiki/WikiName/includes/GlobalFunctions.php(2637): Wikimedia\Rdbms\LoadBalancer->getConnection(0, Array, false)

#2 /var/www/html/wiki/WikiName/includes/cache/localisation/LCStoreDB.php(54): wfGetDB(-1)

#3 /var/www/html/wiki/WikiName/includes/cache/localisation/LocalisationCache.php(410): LCStoreDB->get('en', 'deps')

#4 /var/www/html/wiki/WikiName/includes/cache/localisation/LocalisationCache.php(456): LocalisationCache->isExpired('en')

#5 /var/www/html/wiki/WikiName/includes/cache/localisation/LocalisationCache.php(375): LocalisationCache->initLanguage('en')

#6 /var/www/html/wiki/WikiName/includes/cache/localisation/LocalisationCache.php(294): LocalisationCache->loadSubitem('en', 'messages', 'title-invalid-e...')

#7 /var/www/html/wiki/WikiName/languages/Language.php(2645): LocalisationCache->getSubitem('en', 'messages', 'title-invalid-e...')

#8 /var/www/html/wiki/WikiName/includes/cache/MessageCache.php(990): Language->getMessage('title-invalid-e...')

#9 /var/www/html/wiki/WikiName/includes/cache/MessageCache.php(948): MessageCache->getMessageForLang(Object(LanguageEn), 'title-invalid-e...', false, Array)

#10 /var/www/html/wiki/WikiName/includes/cache/MessageCache.php(890): MessageCache->getMessageFromFallbackChain(Object(LanguageEn), 'title-invalid-e...', false)

#11 /var/www/html/wiki/WikiName/includes/Message.php(1308): MessageCache->get('title-invalid-e...', false, Object(LanguageEn))

#12 /var/www/html/wiki/WikiName/includes/Message.php(863): Message->fetchMessage()

#13 /var/www/html/wiki/WikiName/includes/Message.php(955): Message->toString('text')

#14 /var/www/html/wiki/WikiName/includes/title/MalformedTitleException.php(49):Message->text()

#15 /var/www/html/wiki/WikiName/includes/title/MediaWikiTitleCodec.php(297): MalformedTitleException->__construct('title-invalid-e...', '')

#16 /var/www/html/wiki/WikiName/includes/Title.php(3139): MediaWikiTitleCodec->splitTitleString('', 0)

#17 /var/www/html/wiki/WikiName/includes/Title.php(407): Title->secureAndSplit()

#18 /var/www/html/wiki/WikiName/includes/MediaWiki.php(83): Title::newFromURL(NULL)

#19 /var/www/html/wiki/WikiName/includes/MediaWiki.php(140): MediaWiki->parseTitle()

#20 /var/www/html/wiki/WikiName/includes/MediaWiki.php(781): MediaWiki->getTitle()

#21 /var/www/html/wiki/WikiName/includes/MediaWiki.php(515): MediaWiki->main()

#22 /var/www/html/wiki/WikiName/index.php(42): MediaWiki->run()

#23 {main}

I have tried to manually log in to the mysql server using my $wgDB* credentials, and the credentials seem to work. SHOW DATABASES; indicates that the wiki database exists. At this point, I feel like I don't have enough to go off of to know where to debug next.

Dajagr (talkcontribs)

Okay, I believe I've found the answer. Apparently, MySQL 8.0.4 uses an authentication schema that the MediaWiki PHP isn't able to process properly. The solution appears to be to update the password schema with something similar to the following:

% mysql -u root -p

Enter password: my_password

alter user 'username'@'localhost' identified with mysql_native_password by 'password';