#126 - Incorrect key file for table '.\mysql\db.MYI'; try to repair it

0

0

I posted my question on serverfault but they hold my question by advising to post it in SuperUser

I installed Xampp and can see localhost page as well as both apache and mySQL is starting fine but when I am clicking to phpMyAdmin ==> User then I am seeing following error:

Static analysis:

5 errors were found during analysis.

Unexpected closing bracket. (near ")" at position 52) Unexpected closing bracket. (near ")" at position 112) Unexpected closing bracket. (near ")" at position 181) Unexpected closing bracket. (near ")" at position 249) Unexpected closing bracket. (near ")" at position 315) SQL query: Documentation

(SELECT DISTINCT User, Host FROM mysql.user ) UNION (SELECT DISTINCT User, Host FROM mysql.db ) UNION (SELECT DISTINCT User, Host FROM mysql.tables_priv ) UNION (SELECT DISTINCT User, Host FROM mysql.columns_priv ) UNION (SELECT DISTINCT User, Host FROM mysql.procs_priv ) ORDER BY User ASC, Host ASC LIMIT 0, 25

MySQL said: Documentation

126 - Incorrect key file for table '.\mysql\db.MYI'; try to repair it

I restarted Xampp 2-3 times but same error. Please advise

Thanks in anticipation

Ghayel

Posted 2015-11-02T10:07:18.433

Reputation: 121

Answers

2

Exactly the same happened to me, I tried the following query and it worked:

USE mysql;
CHECK TABLE db;

If it returns db is corrupt, then repair it using

REPAIR TABLE db;
CHECK TABLE db;

You should get status as OK.

Pratik

Posted 2015-11-02T10:07:18.433

Reputation: 21

1

This exact same thing happened to me and I have spent the past 3-4 hours trying to fix it. After a while of researching, I found several potential solutions; such as:

  • Making sure your MySQL /tmp folder had enough space, and that there is enough memory on your machine.
  • Updating your database and phpMyAdmin is up to date.
  • Stopping your XAMPP service, renaming the C:\xampp\mysql\data\mysql\db.MYI to db.OLD and starting the service again.
  • Deleting the C:\xampp\mysql\data\mysql\ibdata1 and rebooting the server (this was a solution to try and combat an issue that occured after renaming the db.MYI file)
  • Installing a supposed patch version of XAMPP with a custom version of phpMyAdmin (https://community.apachefriends.org/f/viewtopic.php?f=16&t=72035&hilit=mysql+can%2527t+start&start=30 - view last post by Beltran)

However, none of these solutions worked for me. From what I can gather, the issue is with XAMPP changing the database service from MySQL to MariaDB and there being some compadibility issues with phpMyAdmin. Even after I installed Beltran's fixed version, I still had trouble creating users and other random errors would pop up. All of the solutions above have supposedly worked for others; hence me condencing and posting them here.

In the end, to fix the problems and errors; I just installed the last version of XAMPP which still had MySQL by default (5.6.12). The only alteration I made was updating phpMyAdmin to the latest version; which worked fine. So far I have been able access the users panel and create new users through the web interface; and there have been no problems so far. Here is a link to download the XAMPP 5.6.12 for Windows - http://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.12/

Hope this helps!

ABorrello

Posted 2015-11-02T10:07:18.433

Reputation: 11

Thanks for your detailed reply but I used very simple way to fix it. Please read it here http://stackoverflow.com/questions/33465785/phpmyadmin-error-i-am-seeing-errors-in-user-accounts

– Ghayel – 2015-11-07T18:30:38.957

Happy you found a solution! Unfortunately for me, I never had my XAMPP directory in the Program Files folder. There is a pop up in the installer that says that there are issues saving it there, so I placed it else where. – ABorrello – 2015-11-09T05:35:41.633