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]
first of all, make a backup file of your database C:\xampp\mysql\data copy this file and past it somewhere in your pc. After this open, the data file and also open the XAMPP server try to delete the files step by step one by one after deleting each file try to run the MySQL server after deleting a single file as shown in the screenshot thus your databases won't delete. if the file deletion does not work then try to copy the same files from the backup folders and repeat this until it works... this is time taking but this worked for me I have solved this in 20 minutes.
It should fix it.
If the answers mentioned above are not working, you can try deleting all the files in data, except for the folder
Goto: C:\xampp\mysql\data
After that: Goto: C:\xampp\mysql\bin
then open with notepad my.ini , Its look like this.
Then delete or put into comment the port 3306 and change it to 8111 then run xamp with administrator and its work well.
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
.
Add the following line below the [mysqld]
section in the mysql config file (my.ini) and restart the apache web server and the mysql service afterwards.
[mysqld]
innodb_force_recovery = 4
I have resolved the problem by ending the task for mysqlid on Task Manager.