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] Attempting to start MySQL app…
12:19:12 PM [mysql] Status change detected: running
12:19:13 PM [mysql] Status change detected: stopped
12:19:13 PM [mysql] Error: MySQL shutdown unexpectedly.
12:19:13 PM [mysql] This may be due to a blocked port, missing dependencies,
12:19:13 PM [mysql] improper privileges, a crash, or a shutdown by another method
12:19:13 PM [mysql] Press the Logs button to view error logs and check
12:19:13 PM [mysql] the Windows Event Viewer for more clues
12:19:13 PM [mysql] If you need more help, copy and post this
12:19:13 PM [mysql] entire log window on the forums
STOP! Please do NOT deleteibdata1
file!
Deleting this file is like playing a Russian roulette with your databases, it could work and restablish everything, but also, probably could leave unusable every database you have.
Instead, first try using the MySQL backup folder which is included with XAMPP. So do the next:
Rename the foldermysql/data
tomysql/data_old
(you can use any name)
Create a new foldermysql/data
Copy the content that resides inmysql/backup
to the newmysql/data
folder
Copy all your database folders that are inmysql/data_old
tomysql/data
(skipping themysql
,performance_schema
, andphpmyadmin
folders fromdata_old
)
Finally copy theibdata1
file frommysql/data_old
and replace it insidemysql/data
folder
Start MySQL from XAMPP control panel
And, voilà!