How to restore mysql database in XAMPP?

后端 未结 4 1075
太阳男子
太阳男子 2021-01-06 16:13

I have a backup of the entire xampp/mysql folder. How can I use it to recover my old db on a fresh installation of XAMPP?

Simply copying the old

4条回答
  •  太阳男子
    2021-01-06 16:52

    I got the following logs:

    2020-02-11 14:26:06 0 [ERROR] mysqld: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed 2020-02-11 14:26:06 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed 2020-02-11 14:26:06 0 [ERROR] Aborting
    

    Well, what I did as follows:

    1. Installed a new instance of XAMPP in a different directory (e.g. C:\xampp_new)
    2. Copied back the three db files from the new installation to the old one:
    • C:\xampp_new\mysql\data\mysql\db.frm to C:\xampp\mysql\data\mysql\db.frm

    • C:\xampp_new\mysql\data\mysql\db.MAD to C:\xampp\mysql\data\mysql\db.MAD

    • C:\xampp_new\mysql\data\mysql\db.MAI to C:\xampp\mysql\data\mysql\db.MAI

    1. Started MySQL service from XAMPP then it worked well.

    I hope it could also be useful information for those who steps into an error like this.

    Be careful when you are trying to set privileges.

提交回复
热议问题