Topic on Project:Support desk

94.173.24.36 (talkcontribs)

Not sure if anyone have had this problem before. My wiki page have working normal up until a couple of days ago. When I try to access my site, I get the following

A database query error has occurred. This may indicate a bug in the software.

Query: SELECT page_title FROM `page` WHERE page_is_redirect = '0' AND page_namespace = '8' AND (page_title NOT LIKE '%/%' ) AND (page_len > 10000) Function: MessageCache::loadFromDB(en)-big Error: 1146 Table 'my_wiki.page' doesn't exist (mysqlhost3)

What's strange is when I try show the tables using putty, it shows that I have a table called page. But when I used the command to select * from page, it says the table does not exist.

Has anyone had this problem before? If so, how did you fix it?

88.130.99.31 (talkcontribs)

Are you really sure that the wiki is using the same database, meaning the one, on which you tried running the SELECT query? Or are you maybe unintendedly using a test instance or so at one place?

If this is not the problem, then it might be that the MySQL server was updated or the database files were moved. If that is the case, restarting the MySQL service and/or recreating the database should help.

94.173.24.36 (talkcontribs)

Yes this is same database wiki is using. My site had been working fine and I never changed anything, but it's not working now. Regarding the MySQL server, putty shows a list of table names, one of which is 'page' (see above error message) but it complains that the table does not exist. However, when I access my tables through phpmyadmin, I don't have the table 'page'.

88.130.73.24 (talkcontribs)

Who is hosting your site? Is it on your local PC? If it is run on someone else's server, ask him, if he changed anything. My best guess until now is that something got broken with the InnoDB tablespace. This most likely happens at one of two occasions: Someone moved the tablespace files, e.g. during a server move. Or MySQL has been upgraded and necessary table upgrades have been forgotten/not finished properly. A power outage would also be an explanation.

You can try to run CHECK TABLE on the page table; I expect that this comes back with a useful error message.

You might also want to use

mysqlcheck db_name

from the PuTTY shell (replacing db_name with your database's name) in order to have all of your tables checked in one go. That will show you, i other tables are affected as well.

88.130.73.24 (talkcontribs)
94.173.24.36 (talkcontribs)

I just tried mysqlcheck db_name but I get an error message ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqlcheck db_name' at line 1

88.130.73.24 (talkcontribs)

Note that mysqlcheck is not a MySQL query. Instead it is an own program. The parameter "db_name" must be replaced with the actual name of the DB; "my_wiki" in your case.

146.176.90.116 (talkcontribs)

Have just tried running that and it gives me the following: (db_name was replaced with the name of my database) Error  : Table 'db_name.page' doesn't exist status  : Operation failed

And aging, the table 'page' shows up when I use show tables

88.130.113.187 (talkcontribs)

This could be a database file corruption. If that's the problem, you may need to restore the wiki from backup.

That particular table may be recoverable from the other table contents, and be able to access its text, but that would be difficult to do.

This post was posted by 88.130.113.187, but signed as Ciencia Al Poder.

88.130.113.187 (talkcontribs)

I would now try to follow the "InnoDB Corruption Repair Guide", which you find on Google and start with "C/2 Corrupted Tables". There are two methods, which might help you recover the table and it's contents. Anyway, both require you to be able to read from the page table, where I am not sure, if that is still possible in your situation.

However, the easiest solution will be as Ciencia said: Just use a database backup and restore from there.

Reply to "Database error"