MySQL in XAMPP is shutting down unexpectedly, causing blank screens in your PHP application.
Another MySQL instance is already running on port 3306.
Solution:
- Check if MySQL Server or MariaDB is installed separately
- Stop any other MySQL services:
- Open Services (Win+R →
services.msc) - Look for "MySQL" or "MariaDB" services
- Stop them if running
- Open Services (Win+R →
- Or change XAMPP MySQL port:
- Edit
C:\xampp\mysql\bin\my.ini - Change
port=3306toport=3307 - Update
db_connect.phpto use port 3307
- Edit
Solution:
- Backup your databases first!
- Stop XAMPP completely
- Rename
C:\xampp\mysql\datatoC:\xampp\mysql\data_backup - Copy
C:\xampp\mysql\backuptoC:\xampp\mysql\data(if exists) - Or reinstall MySQL in XAMPP
Solution:
- Add XAMPP folder to antivirus exclusions
- Allow MySQL through Windows Firewall
Solution:
- Run XAMPP Control Panel as Administrator
- Check folder permissions for
C:\xampp\mysql\data
Location: C:\xampp\mysql\data\*.err or check XAMPP Control Panel → MySQL → Logs
-
Stop all MySQL instances:
# Stop XAMPP MySQL # Then check for other MySQL services Get-Service | Where-Object {$_.Name -like "*mysql*"}
-
Check XAMPP MySQL Logs:
- Open XAMPP Control Panel
- Click "Logs" button next to MySQL
- Look for specific error messages
-
Try starting MySQL manually:
- Open Command Prompt as Administrator
- Navigate to:
C:\xampp\mysql\bin - Run:
mysqld.exe --console - This will show detailed error messages
-
If port is blocked, change it:
- Edit
C:\xampp\mysql\bin\my.ini - Find
[mysqld]section - Change
port=3306toport=3307 - Restart MySQL
- Edit
Once MySQL is running:
- Access
http://localhost/aliza/university/error_check.phpto verify connection - If database doesn't exist, run
install.phporsetup.php - Your application should work normally