There are many reasons MySQL not starting in xampp error on port 3306 and how to free port 3306 for mysql, you have to change the port address of MySQL and there are several ways to fix this MySQL xampp not starting error and the main reason for MySQL not starting in xampp is if the port 3306 is already in use then on this particular port MySQL will not start running and there are very easy ways to fix this frustrating error. Lets see them in details.
TO fix MySQL not starting in xampp error on port 3306 you need to change the port address of MySQL and it will start working normally once you kill process port 3306.
How to Fix MySQL not Starting in Xampp error on port 3306:
SC MySQL delete Command: Change MySQL Port
You can also solve this issue by deleting MySQL services here, go ahead and execute the following command in cmd.
Step 1: Open CMD and run as administrator.
Step 2: Execute this command in CMD: sc delete mysql and hit enter.
Step 3: Once executed it will show you deleteServices success and will stop all services of mysql running will be stopped.
Step 4: Now close the xampp control panel and quit and restart it.
Step 5: Now start the MySQL and Apache you will attempt to start mysql.
Step 6: Go ahead and click on config in Xampp control panel and open my.ini file.
Step 7: Once you open my.ini file, press ctrl+f and search for 3306.
Step 8: Now change my sql port from 3306 to 3307.
Note: Old port of MySQL 3306 will be replaced with 3307 here.
Step 9: Save the file and close.
Step 10: Now open Xampp control panel config file at the top.
Step 11: Click on services and port settings
Step 12: click on MySQL tab and change port no from 3306 to 3307(new MySQL port).
Step 13: Click on save.
Step 14: Close control panel and quit control panel and restart xampp control panel.
Step 15: Start xampp server and start mysql, you will be seeing the port now which is attempting to connect is 3307 and will be connected in xampp server.
Step 16: Now when ever you start xampp server and start Apache and MySQL, they will be connected without having any trouble of MySQL not starting in xampp error on port 3306, since we have changed port of MySQL here from 3306 to MySQL 3307.
For confirmation you can go ahead and start your localhost in your browser and see and open phpMyAdmin will start working without having any problem.
By using Netstat ao command in Command Prompt:
Step 1: In windows search bar type cmd
Step 2: Right click on cmd and select run as administrator.
Note: Make sure that you run as administrator or it will not terminate the port 3308. The port cannot be terminated if you don’t have administrator privileges.
Step 3: In cmd type: netstat -ao and hit enter
Step 4: Now search for MySQL port number 3306 (under local address) and note PID number of 3305 MySQL port, in my case it is 38368.
Step 5: Now type this command : taskkill /F /PID 38368 and hit enter. (make sure /F is capital and /PID is capital).
Step 6: Once you hit enter then your then you will see message saying SUCCESS: The process with PID 38368 has been terminated.
That’s it restart the xampp server again you will be able to connect mysql on port 3306 and will not be facing any issue of MySQL not starting in xampp error on port 3306.
Note: This is the best fix and will work 100 percent if you are facing any issue in connecting or starting xampp server and MySQL is not starting issue. Just kill the process port which is already running and xampp server will start working.
Why mysql not starting in xampp on port 3306?
If any 3306 port is already running by any other services on your computer, they both port which is assigned by default to MySQL port is 3306 will get conflict with your local computer and will not start saying port is already in use and MySQL not starting in xampp error on port 3306.
By changing MySQL port your problem will be solved.
Change the port of MySQL which is by default 3306 change it to 3307 and will start working.
Open my.ini file and search for 3306 and change port number to 3307 and save my.ini file and restart xampp server. It will start working.
Port no 3306 is default port no which is assigned to MySQL.
No. you are changing only port number here which is default here, no problems you can change it to what ever MySQL port number you want.