Reputation: 6527
I'm trying to start MySQL from XAMPP (under Windows Vista), but it's saying that's port 3306 is busy.
What would be the best way with check what application is using that port and how to free it?
Upvotes: 22
Views: 204279
Reputation: 34632
In a command shell, run:
netstat -b -p TCP
and look for a line that says localhost:3306
in the second column. Below this is the application's name using the port.
Upvotes: 11
Reputation: 3
I'm not sure if this is available only on the latest version of XAMPP but just copy everything in the backup folder in XAMPP->MYSQL->BACKUP and paste (replace everything) in your data folder in XAMPP->MYSQL->DATA
This did the trick for me.
Upvotes: 0
Reputation: 1
Upvotes: 0
Reputation: 93
This command kills the existing mysql process and perhaps one can start it afresh
sudo pkill mysql
It has helped me solve this challenge most of times
1. Turn off the application which is using this port, open terminal and run "lsof -n -P -i | grep 3306" to figure out.
2. Use different ports, right click on the server -> Edit.
Upvotes: 2
Reputation: 11
This error occurs if you have installed mysql two times. mysql by default uses the port 3306. If you have installed it twice then already there is a mysql at your port number 3306. So you will have to change your port.
If you are using xampp then you can easily change your port. Steps to change port: Step 1: Open your xampp as administrator. Step 2: Click on 'Config' at the top right corner of your xampp. Step 3: Click on 'Service and Port Settings' and after that change the main port of mysql from 3306 to 3307 and the click on save. Step 4: Then click on 'config' which is in front of mysql and open 'my.ini' file which will be a text file. Step 5: Now wherever in the text file you see the port number mentioned as 3306 change it to 3307 and then save the file.
After doing this again start your mysql server and it will start running on port 3307.
This worked for me and I hope it will work for anyone else who encounters the same issue.
Upvotes: 1
Reputation: 61
I've been having trouble for hours on this error. I was trying to run MySQL from XAMPP after quite some time. It gave errors, similar to yours, it said that port 3306 is in use. If you:
netstat
This is the solution that worked for me:
Open Network & Internet settings
Change adapter options
I ran MySQL again at now it works.
Upvotes: 5
Reputation: 494
I had this problem (slight variation as I was using MAMP)
I found this problem was due to having MySQL Workbench installed, MySQL Workbench started the mySQL service on bootup which in turn stopped MAMP being able to use the port.
To fix this I had 2 options,
This then allowed MAMP to use port 3306
Upvotes: 1
Reputation: 1137
If you where not able to find any application or process listening on port 3306
, you might need to check your network adapters.
Disable adapters you do not use.
Pay also attention to the Hyper-V generated network adapter, disable it if you don't need it. Sometimes it can reserve some ports and commands like netstat
will not be able to find it out
Upvotes: 0
Reputation: 23
Windows icon -> Open cmd.exe.
Type netstat -a -b
.
Find what's using it. In my case it was this:
So, I went to task manager. There were no process called so. The I went to services and disabled these two:
Now everything works fine.
Upvotes: 2
Reputation: 304
As Mentioned By @Segun Emmanuel Run the Following Command:
netstat -a -b
You will get a list of Applications that are using different PORTS. Press Ctrl + F
and write 3306 to find out which Application is using PORT 3306.
After this, Go to Task Manager via Search Bar or by pressing CTRL + ALT + DEL
. Then Under the Background Processes, find out mysqld.exe
, right-click on it and you will find an option to close it, namely "End Task
".
Then go to your Xampp Control Panel and start the MySQL service.
Upvotes: 4
Reputation: 1
For this problem, a simpler way on Windows is:-
Upvotes: 0
Reputation: 1018
If mysql is not starting in xampp, it might be a port conflict issue. Mysql run by default on port 3306. you need to check if another application is occupying that port. use following command to check app occupying a port
Linux: netstat -tulpn | grep 3306
Window: netstat -a -b
Mac: lsof -nP -i4TCP:3306
if you find an application occupying that port, stop the application and restart xampp. As an alternative, you can go to php.ini file or click configure in the xampp for mysql and change the mysql port to 3307
Upvotes: 3
Reputation: 489
In my case it was javaw.exe which was starting on port 3306. This exe does not cause problem if I am logged in using single user in my Windows 10. But if I have multiple logins, it starts this exe for each user and blocks MySQL to start on 3306 port.
Going to task manager and killing this exe for the other user fixed the issue and MySQl could start.
Upvotes: 2
Reputation: 81
I had the same problem and was stuck on this thing for a day and I couldn't find a perfect answer anywhere. So I gave it a shot on my own and it worked. This solution is for Windows users. I use Windows 7.
My xampp control panel was displaying an error that port 3306 is busy and in use by some file (name was specified).. say "filename.de".
Now follow the following steps:
Upvotes: 8