XAMPP - MySQL shutdown unexpectedly

前端 未结 30 2367
长情又很酷
长情又很酷 2020-11-22 09:42

When I open XAMPP and click start MySQL button and it gives me an error. I had started it just before, but now it isn\'t working.

12:19:12 PM [mysql]

30条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 10:19

    When you're not running XAMPP as an administrator, shutting down MySQL frequently causes corruption which means you have to repair or delete your tables. To avoid this you need to either run XAMPP as an administrator, or use the proper command prompt method for shutting down MySQL.

    You can delete ibdata1 as Kratos suggests, but this can leave you with a broken database as other pieces of your database are still in the /mysql/data/ folder. In my case, this residual data stopped me successfully installing WordPress.

    A cleaner way of undoing the damage is to revert your whole /mysql/data/ folder. Windows has built-in folder versioning — right click on /mysql/data/ and select Restore previous versions. You can then delete the current contents of the folder and replace it with the older version's contents.

    Addendum: To ensure that you don't forget to run XAMPP as an administrator you can right click the XAMPP shortcut, go to Properties, then Advanced, and finally tick Run as administrator.

提交回复
热议问题