How to solve "Error: MySQL shutdown unexpectedly"?
IMPORTANT: do NOT delete
ibdata1
file. You could destroy all your databases.
Instead, first try using the MySQL backup folder which is included with XAMPP. So do next steps:
- Rename folder
mysql/data
tomysql/data_old
- Make a copy of
mysql/backup
folder and name it asmysql/data
- Copy all your database folders from
mysql/data_old
intomysql/data
(exceptmysql
,performance_schema
, andphpmyadmin
folders) - Copy
mysql/data_old/ibdata1
file intomysql/data
folder - Start MySQL from XAMPP control panel
And, voilà!
IMPORTANT Deleting this file may render any existing MySQL data unusable. Use with caution
Hey I just did this and it worked:
- exit Xampp server
- go to your
C:\xampp\mysql\data
directory -
delete the
ibdata1
file - restart xampp server
It should work
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.
- Go to mysql/data/
- Delete all random files (except the actual database folders)
- Restart Apache and MySQL.
It should fix it.