Topic on Project:Support desk

Error: 1146 Table 'pjk_uawiki.user' doesn't exist (localhost)

2
110.171.63.6 (talkcontribs)

My host did something to the db and are unable to restore a backup or fix it, so I need to try fixing it myself. I had a massive spam attack, and mostly cleared it up, but seems there is an issue with the db now. See this link: http://underasia.com/wiki/index.php/Thai_Language_Resources

MediaWiki (reported by your wiki's Special:Version page): can't check, but version that was out about 8 months ago. PHP (likewise): 5.3.26 Database (likewise, e.g. MySQL 5.5): MySQL 5.1.73-cll

Any ideas how to fix this? The only support I have so far is: "It seems like the user table missing is the only error being reported at this time and you may be able to fix this by re-installing a blank user table.

If you pull the "create table" sections from the database install script for this site and run them it may get it functioning again."

But I'm unsure how to actually do this. Any help would be greatly appreciated.

I've tried to run the upgrade process but get this error when upgrading the db: "Turning off Content Handler DB fields for this part of upgrade. ...have ipb_id field in ipblocks table. ...have ipb_expiry field in ipblocks table. ...already have interwiki table ...indexes seem up to 20031107 standards. ...hitcounter table already exists. ...have rc_type field in recentchanges table. ...user table does not exist, skipping new field patch. ...querycache table already exists. ...objectcache table already exists. ...categorylinks table already exists. ...have pagelinks; skipping old links table updates ...il_from OK ...have rc_ip field in recentchanges table. ...index PRIMARY already set on image table. ...have rc_id field in recentchanges table. ...have rc_patrolled field in recentchanges table. ...logging table already exists. ...user table does not exist, skipping new field patch. ...watchlist table does not exist, skipping new field patch.

An error occurred: A database query syntax error has occurred. The last attempted database query was: "SELECT count(*) FROM `watchlist` WHERE wl_namespace & 1 LIMIT 1 " from within function "MysqlUpdater::doWatchlistUpdate". Database returned error "1146: Table 'pjk_uawiki.watchlist' doesn't exist (localhost)" Backtrace:

  1. 0 /home/pjk/public_html/underasia/wiki/includes/db/Database.php(983): DatabaseBase->reportQueryError('Table 'pjk_uawi...', 1146, 'SELECT count(*...', 'MysqlUpdater::d...', false)
  2. 1 /home/pjk/public_html/underasia/wiki/includes/db/Database.php(1434): DatabaseBase->query('SELECT count(*...', 'MysqlUpdater::d...')
  3. 2 /home/pjk/public_html/underasia/wiki/includes/db/Database.php(1148): DatabaseBase->select('watchlist', 'count(*)', 'wl_namespace & ...', 'MysqlUpdater::d...', Array)
  4. 3 /home/pjk/public_html/underasia/wiki/includes/installer/MysqlUpdater.php(346): DatabaseBase->selectField('watchlist', 'count(*)', 'wl_namespace & ...', 'MysqlUpdater::d...')
  5. 4 [internal function]: MysqlUpdater->doWatchlistUpdate()
  6. 5 /home/pjk/public_html/underasia/wiki/includes/installer/DatabaseUpdater.php(435): call_user_func_array(Array, Array)
  7. 6 /home/pjk/public_html/underasia/wiki/includes/installer/DatabaseUpdater.php(387): DatabaseUpdater->runUpdates(Array, false)
  8. 7 /home/pjk/public_html/underasia/wiki/includes/installer/DatabaseInstaller.php(274): DatabaseUpdater->doUpdates()
  9. 8 /home/pjk/public_html/underasia/wiki/includes/installer/WebInstallerPage.php(552): DatabaseInstaller->doUpgrade()
  10. 9 /home/pjk/public_html/underasia/wiki/includes/installer/WebInstaller.php(270): WebInstaller_Upgrade->execute()
  11. 10 /home/pjk/public_html/underasia/wiki/mw-config/index.php(65): WebInstaller->execute(Array)
  12. 11 /home/pjk/public_html/underasia/wiki/mw-config/index.php(33): wfInstallerMain()
  13. 12 {main}

Purging caches...done."


Thanks.

88.130.85.98 (talkcontribs)

Your database currently misses at least the tables "user" and "user_newtalk". From browsing a few pages in your wiki I got the error messages that also the tables "valid_tag" and "watchlist" are missing - and almost certainly other tables as well. The table structure of these tables must be restored to give MediaWiki at least a chance to work properly again. However, you will also need the table contents: E.g. the user table contains information on your wiki's user accounts - the wiki cannot work without it. Without the stuff from the watchlist table your wiki might still work, but the information on which user watched which pages would then be lost.

To get your wiki working again, you will at least have to restore the user table - and those other tables, which are missing as well. See DB for an overview of the tables which you should have. If you want to get the wiki working again, it is absolutely essential that you get this information back.

From what you describe, I consider the current state to be broken beyond repair. I would not try to somehow fix the broken state, which you have now (e.g. by manually recreating the structure of missing tables or so). Instead, I would go back to the newest backup. That will be far easier.

Reply to "Error: 1146 Table 'pjk_uawiki.user' doesn't exist (localhost)"