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]
IMPORTANT Deleting this file may render any existing MySQL data unusable. Use with caution
Hey I just did this and it worked:
C:\xampp\mysql\data directoryibdata1 fileIt should work
Stop there! Please do NOT delete ibdata1 file!
Deleting this file is like playing a Russian roulette with your databases, it could work and restablish everything, but also, probably could harm every database you have. Instead, first try using the MySQL backup folder which is included with XAMPP. So do the next:
mysql/data to mysql/data_old (you can use any name)mysql/datamysql/backup to the new mysql/data foldermysql/data_old to mysql/data (skipping the mysql, performance_schema, and phpmyadmin folders from data_old)ibdata1 file from mysql/data_old and replace it inside mysql/data folderAnd, voilà!
In my case in which I synced my mysql data and htdocs to dropbox, I just needed to delete the conflicted files in mysql/data folder and subfolders. The conflicted files can be identified by its names, dropbox will tell you that. It has solved the problem for me.
For me, the problem was:
I used to hibernate my PC instead of shutting down due to the scale of the project. I was lazy enough to reopen all programs.
Before trying anything else, I recommend you to do the following simple things. Otherwise, you will be messed up your MySQL server.
If not works,
Also, make sure to check 3306 & 5040 ports. These two ports are required to run MySQL on default settings.
Check @Ryan Williams answer to find of why it's good to run XAMPP as administrator.
I also faced this issue and this is how I solved.
1. Make sure xampp is not under sub-directory. For example, it should be C:\xampp
2. You might need to run as administrator in running the application.
Hope this will work!
My Xampp MySQL worked just follows as below:
01.Go to mysql/data/ directory
02. delete the ibdata1 & ib_logfile*(ib_logfile0,ib_logfile1,ib_logfile101) file
03. restart xampp server