Topic on Project:Support desk

Database error after updating MediaWiki from 1.5.2 to 1.6

7
75.159.252.105 (talkcontribs)

I was in the process of updating MediaWiki when my database crashed.

I downloaded the tar of the latest release, copied the files into /var/www over the existing ones there, and ran /var/www/maintenance/update.php from the command line. The update script crashed with the error:

Database returned error "1142: CREATE command denied to user 'wikiuser'@'localhost' for table 'user_properties' (localhost)"

Opening the wiki in my browser gives the following error:

Database error

A database error has occurred Query: SELECT lc_value FROM `l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'deps' LIMIT 1 Function: LCStore_DB::get Error: 1146 Table 'wikidb.l10n_cache' doesn't exist (localhost)

Any idea how I can fix this? My wiki is currently completely unusable.

75.159.252.105 (talkcontribs)

Fixed my own issue. I'll post the fix in case anyone else is having similar problems. I'm on Ubuntu, BTW.

I entered admin mode on the console with "sudo su", which logged me in as the user "root". In LocalSettings.php, $wgDBuser and $wgDBadminuser were set to "wikiuser". By changing them to "root" and running "sudo php5 update.php" I was able to complete the update and fix the database error.

The update manual should really include this!

Bryan (talkcontribs)
Eckirchn (talkcontribs)

Thanks to hexmode @ #mediawiki@freenode.net i learned that the error:

 Database returned error "1142: CREATE command denied to user 'wikiuser'@'localhost' for table 'user_properties' (localhost)"

Could be resolved by editing LocalSettings.php to change the wikiuser to the sql administrator, then change it back after update.

217.227.72.75 (talkcontribs)

Hey there.

I have the same problem, but changing the Usernames does not help in any way. Also it's not possible for me to track, if update.php does anything at all, due to the lack of a console. So what can I do now? Every attempt to update from 1.9 to 1.16 failed till now.

77.3.134.45 (talkcontribs)

Hi, I'm updating from 1.15 to 1.16 and I have the same problem. It seems that the entrie in LocalSettings.php are not used at all. The error message point always to "wikiuser" however I replaced "wikiuser" with "root" for $wgDBadminuser and $wgDBuser. BTW I'm using Ubuntu. Has anybody an idea how to get this update done?

95.112.249.171 (talkcontribs)

I could solve the problem: Version 1.15 uses AdminSettings.php. 1.16 does not use this file. The parameters should go instead into LocalSettings.php. BUT: If AdminSettings.php is still present it will be used. I just renamed AdminSettings.php and put all parameters into LocalSettings.php. Then I was able to use "root" as $wgDBadminuser and $wgDBuser.

Reply to "Database error after updating MediaWiki from 1.5.2 to 1.6"