Windows 10 Enterprise — MYSQL shutdown unexpectedly
I’ve installed Windows 10 Enterprise 64bit on machine and attempting to install Apache, PHP and MySQL on my machine to use for web development. In short I keep running into an error «MySQL shutdown unexpectedly». I’ve attempted to install using WAMP and XAMPP on my machine and still run into the same error. Apache connects and works on both WAMP and XAMPP however I get the same MySQL error.
So far from all the research I’ve done please find a synopsis of my situation and the solutions I’ve tried. I’m thinking this is to do with Windows 10. Also as a side note I’m using bootcamp on my MacBook 12 inch so not sure if this adding to the problem but I would not have thought so.
- Apache running on port 80:433 for both XAMPP and WAMP
WAMP — Mysql -> service, start/resume service is green. When I click on it nothing happens. XAMP I get:
8:50:59 AM [mysql] Error: MySQL shutdown unexpectedly.
8:50:59 AM [mysql] This may be due to a blocked port, missing dependencies,
8:50:59 AM [mysql] improper privileges, a crash, or a shutdown by another method.
8:50:59 AM [mysql] Press the Logs button to view error logs and check
8:50:59 AM [mysql] the Windows Event Viewer for more clues
8:50:59 AM [mysql] If you need more help, copy and post this
8:50:59 AM [mysql] entire log window on the forums
Turned off windows firewall, same errors
4.I’ve checked for skype but it is actually not installed on my machine.Also checked control panel -> view local services, skype is not there nor running Tried netstat-b in the command prompt and I can’t see anything with port 80. Also tried netstat -aon | findstr :80, only TCP 192.168.0.10:49556 23.205.116.42:80 ESTABLISHED 1884. Note: If the port was an issue Apache should not be working
I checked the control panel -> view local services there is no World Wide Web Publishing Service.
Followed solution in Xamp-Mysql Shutdown which included deleting ib_logfile1, ib_logfile and ibdata1. As well as appending my.ini with innodb_force_recovery = 1. I get a slightly different error which I put below.
I’m pretty much out of options and about to give into the fact that MySQL may not work on my windows 10 machine. But before I do any help would be appreciated.
Xampp mysql Error: MySQL shutdown unexpectedly
when I starting mysql, giving the following error:
then, I check the mysql_error.log:
finally, I moved xampp/mysql/backup files into xampp/mysql/data and run mysql again.Then, it worked!But I don’t know why.What led to this problem.
Hope someone doubts for me!
3 Answers 3
If you’re not running XAMPP as an administrator, shutting down MySQL can cause corruption which means you have to repair or delete your tables. This can easily be avoided by running XAMPP as administrator.
I searched on google and tried everything like port changing, delete files, reinstall xampp, copy and paste backup files to mysql/data folder but nothing worked.
I found the best solution to this problem.
Solution:
- go to xampp/mysql/data and take a backup of this folder
- delete all selected files in the below image
- Copy selected files in below image from xampp/mysql/backup and paste it to xampp/mysql/data folder
- Now restart your xampp server and it will run like before. no need to delete your database or reinstall your xampp server
Error: MySQL shutdown unexpectedly
Here is the screenshot of my XAMPP Control panel:
Here is my Error Log :
2 Answers 2
I came across similar problem and tried this Stack Overflow answer by Fabrizio Valencia. It worked.
Stop there! Please do not delete anything! First try to do what I did.
OK, none of the listed answers here solved my problem, even, some of the answers were making me lost all my db data. So I did exactly what the error message in XAMPP message panel told me to do. So I did this:
- Rename the folder mysql/data to mysql/data_old (you can use any name)
- Create a new folder mysql/data
- Copy the content that resides in mysql/backup to the new mysql/data folder
- Copy all your database folders that are in mysql/data_old to mysql/data
- Finally copy the ibdata1 file from mysql/data_old and replace it inside mysql/data folder
- Start MySQL from XAMPP control panel
And, voilà. No databases lost, no ports changed, no run as administrator, no force recovery, no kill mysqld process, no restoring from previous versions, no more errors.
IT WORKS FOR ME (Partially) : Please read all
I copied all data (folders and files) from «xampp\mysql\backup» and pasted and replaced it inside «xampp\mysql\data«. That’s all.
Note: Make sure you have backup of these two folders («backup» & «data») including files and folders in another place. So that you can rollback anytime.
Warning: Another problem arose for me. I was unable to access few Tables from different Databases. DB Tables Rows,Type, Size, Overhead columns are empty and Collation column is showing «in use«.
But, it was okay for me. Because most of them are running. But, Still I am looking for the answer. For that reason, I am sharing my MySQL logs before and after fixing the problem. So that it might help others to find the actual reason.
MySQL Logs: Before fixing the issue (2020-07-22 10:18:46)
MySQL Logs: After fixing the issue (2020-07-22 15:34:45)
MySQL Logs: First log about 8 months before. (2019-12-05 22:27:34)
Error: MySQL shutdown unexpectedly XAMPP [closed]
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 months ago .
But result showing same. Can Anyone help?
Thanks In Advance S K Setia
5 Answers 5
xampp->mysql->data cut all files from data folder and paste to another folder
now restart mysql
paste all folders from your folder to myslq->data folder
and also paste ib_logfile0.ib_logfile1 , ibdata1 into data folder from your folder.
your database and your data is now available in phpmyadmin..
Man, if you have MySQL server install and running, stop it. The error occured because of conflicting MariaDB and the other server.
Solution:
Check MySQL Error Log
Start MySQL on XAMPP Control panel.
Check the My SQL Error log “mysql_error.log” by clicking on the Logs button on XAMPP control panel.
Go to the “data” directory in the mysql database. I installed XAMPP on D: drive on my computer & the mysql “data” directory location of my computer was “D:\xampp\mysql\data\”. You may have different location.
Take Backup of MySQL “data” Folder
First of all you should create a backup of the “data” folder using any compression software.
Give a name like “data_backup.zip” or any type of compression you wish. I used winrar compression software to compress & backup mysql “data” folder.
Rename the “data” folder
- Rename the “data” folder to “data-oldfiles”.
- This is very important to rename the data directory to any new directory name.
Create a new “data” folder
Create a new folder and give the folder name as “data“
To solve the problem we need to create a new “data” directory in the mysql database. Copy content from “backup” folder
Go to the “backup” folder and copy all files.
Paste the files from backup folder to data folder
Now start the MySQL database from XAMPP.
Now, your MySQL database will start properly without showing any error.
Transfer all MySQL projects Database, Data file & Log files
If you have many database which was used for various projects, then you have to transfer all database from “data-oldfiles” folder to “data” folder.
Copy all databases from the data-old files and paste to the data folder.
Now you have to copy the data file “ibdata1” & all log files “ib_logfile0, ib_logfile1 ” from data-old files folder to the data folder. If you have many id_logiles then copied all of them.
MySQL error This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Start MySQL from XAMPP
Now Start MySQL from XAMPP.
Go to phpMyAdmin to check all databases are available & working.
Now start your any website project from localhost to check the MySQL database. The Problem is solved: Now you will see the problem is solved and the error message “Error: MySQL shutdown unexpectedly.” will not show again. If you have any question on this issue please feel free to ask any question in the comments section.
[SOLVED] Error: MySQL shutdown unexpectedly.
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.
Answer
Stop there! Please do not delete anything!
Some of the answers in Stackoverflow or in other platform could leave completely unusable your database!, so, before deleting files, first try to do what the error message in XAMPP message panel recommend you to do, using the MySQL backup folder which is included with XAMPP. So do the next:
Step 1. Rename the folder c:\xampp\mysql\data to c:\xampp\mysql\data_old (you can use any name).
Step 2. Create a new folder c:\xampp\mysql/data.
Step 3. Copy the content that resides in mysql\backup to the new mysql\data folder.
Step 4. Copy all your database folders that are in mysql\data_old to mysql\data (skipping the mysql, performance_schema, and phpmyadmin folders from data_old).
Step 5. Finally copy the ibdata1 file from mysql\data_old and replace it inside mysql\data folder.
Step 6. Start MySQL from XAMPP control panel.
And, Its DONE . No databases lost, no ports changed, no run as administrator, no force recovery, no kill mysqld process, no restoring from previous versions, no more errors.