Error: MySQL shutdown unexpectedly.
10:43:27 PM [mysql] This may be due to a blocked port, missing dependencies,
10:43:27 PM [mysql] improper privileges, a crash, or a shutdown by another method.
10:43:27 PM [mysql] Press the Logs button to view error logs and check
10:43:27 PM [mysql] the Windows Event Viewer for more clues
10:43:27 PM [mysql] If you need more help, copy and post this
10:43:27 PM [mysql] entire log window on the forums
2. Corrupted ibdata1
file 📁
The ibdata1
file is crucial for InnoDB, the storage engine MariaDB uses. If this file becomes corrupted, MariaDB can fail to start. The log you provided shows that the server is successfully starting “crash recovery,” which suggests there may be an issue with the data files that requires attention.
Solution: This is a more drastic solution, so only attempt it if the port conflict solution doesn’t work.
- Back up your databases first! 💾 This is critically important to prevent data loss. Copy your entire
C:\wamp\mysql\data
folder to a safe location. - Stop all WampServer services. Make sure the Wamp icon is red.
- Go to
C:\wamp\mysql\data
. - Delete all files except for the folders corresponding to your databases. You should keep your database folders and the
mysql
,performance_schema
, andphpmyadmin
folders. - Try starting WampServer again. The
ibdata1
file will be recreated automatically, which should fix the corruption issue.
temporary solution
- Make a backup for this folder C:\xampp\mysql\data (make sure your backup folder’s name is not backup) .
- Now Copy all files/folders from C:\xampp\mysql\backup except ibdata1 to avoid error of table does not exist .
- Paste all copied files/folders to C:\xampp\mysql\data
permanent solution
Increase memory in my.ini: innodb_buffer_pool_size=512M
innodb_data_file_path=ibdata1:60M:autoextend
innodb_log_group_home_dir=”C:/wamp/mysql/data”
#innodb_log_arch_dir = “C:/wamp/mysql/data”
## You can set .._buffer_pool_size up to 50 – 80 %
## of RAM but beware of setting memory usage too high
innodb_buffer_pool_size=256M
[ERROR] InnoDB: The Auto-extending innodb_system data file ‘C:\wamp\mysql\data\ibdata1′ is of a different size 768 pages than specified in the .cnf file: initial 3840 pages, max 0 (relevant if non-zero) pages! reverted to innodb_data_file_path=ibdata1:10M:autoextend
restart mysql
Open your my.conf from xampp/mysql/bin/my.conf and find this two lines.
innodb_buffer_pool_size=10M
change this to 30M 0r 50MB. and than
innodb_data_file_path=ibdata1:20M:autoextend
change this too
innodb_data_file_path=ibdata1:60M:autoextend
1. MySQL Won’t Start
Symptoms:
-
You click Start in XAMPP, it turns green briefly, then stops.
-
Error log shows
Port 3306 in use
orCan't open socket
.
Fixes:
-
Check Port Conflict
-
In XAMPP Control Panel → Config → Service and Port Settings → MySQL tab → Change port from
3306
to3307
(or another free port). -
Save and restart XAMPP.
-
-
Stop Conflicting Services
-
Often Skype, MySQL service from other installations, or WAMP uses 3306.
-
In Command Prompt (Admin):
-
-
Remove Multiple MySQL Instances
-
Uninstall other MySQL server packages or disable them in Windows Services (
services.msc
).
-
2. MySQL Service Not Installed
Symptoms:
-
Error:
mysqld.exe not found
or service missing.
Fixes:
-
In XAMPP Control Panel → Shell → run:
-
Or reinstall XAMPP MySQL component without deleting your
mysql/data
folder.
3. Access Denied for Root User
Symptoms:
-
Error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost'
.
Fixes:
-
Stop MySQL in XAMPP.
-
Edit
my.ini
(XAMPP → mysql → bin) → under[mysqld]
add: -
Start MySQL, open phpMyAdmin, and run:
-
Remove
skip-grant-tables
and restart.
4. phpMyAdmin “Cannot Connect: Invalid Settings”
Fix:
-
In
phpMyAdmin/config.inc.php
, check:
5. Table Crashes or Corruption
Symptoms:
-
“Table doesn’t exist” or “#145 – Table was marked as crashed”.
Fixes:
-
In phpMyAdmin, select the database → tick the table → choose Repair table from dropdown.
-
Or from MySQL shell:
6. MySQL Keeps Crashing
Possible Causes:
-
Bad plugins or corrupted
ibdata1
. -
Large queries exhausting memory.
Fixes:
-
Backup
mysql/data
folder. -
Delete
ib_logfile0
andib_logfile1
(will be recreated). // sometimes not works -
Check error logs at
mysql/data/mysql_error.log
. -
Increase memory in
my.ini
:
7. Import Errors in phpMyAdmin (File Too Large)
Fixes:
-
Edit
php/php.ini
and increase: -
Restart Apache and MySQL.