MyBB Community Forums

Full Version: mybb_users table broken during upgrade on MySQL 5.1.73
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My problem is solved already, but just to let you know if this happens to someone else...

I was running the upgrade script (1.6.15 -> 1.8.0) on my production site and got this:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:1034 - 137 when fixing tableQuery:ALTER TABLE mybb_posts ADD INDEX (`tid`, `dateline`)

I looked at the database in phpMyAdmin and found that table mybb_posts was marked as 'crashed' and should be repaired. The table has 90000+ rows on my forum. I tried "REPAIR TABLE mybb_users" but the command never finished. Finally I had to rebuild the forum from backups into my test site and make the upgrade there (it finished OK), and then export the upgraded db tables into my production server.

The MySQL version on my production site was 5.1.73, and on the test site (where the upgrade worked using same tables) 5.5.37. Also I noticed (later on), that the db driver on my /inc/config.php was mysql, while on the test site I used mysqli.

So, either my db was somehow corrupted to begin with (it's been running since 2007 and upgraded from MyBB 1.2 on, never being recreated) - or the upgrade process doesn't like the combination of mysql driver and MySQL version 5.1.x.

In any case, I suggest you test the upgrade on a test site carefully, and make sure you have current backups available (both files and db).
If your database did not shut down correctly, that can cause a table to become crashed. For running the REPAIR TABLE command on a table with many rows, you might consider increasing the amount of time before it timeouts. The same applies if you are altering the structure of any large table.