[SOLVED] “[ERROR] Fatal error: Can’t open and lock privilege tables: Incorrect key file for table ‘user’; try to repair it”

I am working on a computer with XAMPP installed on Windows 7. When I upgraded XAMPP to fix the earlier problem with WinMySQLAdmin, a new problem with mysql was introduced. The error log (mysql_error.log) showed the following entry at the end:

[ERROR] Fatal error: Can’t open and lock privilege tables: Incorrect key file for table ‘user’; try to repair it

To fix, I downgraded to earlier version of XAMPP, exported the database and removed the mysql data directory, and reinstalled the latest version of XAMPP. Now, MySQL could start without problems. Then, I imported the data back and all was well.

If you enjoyed this post, make sure you subscribe to my RSS feed!
  • Ginger

    Thank you!!! That helped. 🙂

  • Kemmy

    Thanks bro!!! that awesome ….

  • In may case, copy this 3 files:

    – user.frm

    – user.MYD

    – user.MYI

    from C:xamppmysqlbackupmysql

    to

    C:xamppmysqldatamysql

    and override it.

    and works