SQL Port error solve
Step 1: Check MySQL port
Open XAMPP Control Panel as Administrator.
Click Netstat.
Check whether port
3306is already being used.
You can also check using CMD:
netstat -ano | findstr :3306If you see something like:
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1234Another process is using port 3306.
To identify it:
tasklist | findstr 1234Replace 1234 with your actual PID.
Step 2: Check Windows MySQL service
Press
Win + R.Type
services.msc.Press Enter.
Find these services if present:
MySQL
MySQL80
MariaDB
If another MySQL service is running, stop it temporarily and try starting MySQL in XAMPP.
Step 3: Check MySQL error log
In XAMPP:
Click MySQL → Logs.
Open
mysql_error.log.Go to the bottom.
Copy the last 20–30 lines.
This log will help identify the actual problem.
Step 4: If database files are corrupted
Don't replace or delete the data folder yet. First make a complete backup of:
C:\xampp\mysql\dataWe can recover your databases without losing your existing projects.
Post a Comment