MySQL database connectivity error is a common thing in web development. Most of the developers using wamp server in localhost. Sometimes wamp server doesn’t connect with the MySql database due to a port connectivity issue. In this post, I will show detailed steps to fix the 3306 port issue in the wamp server.
Wampserver contains PHP, MySQL and Apache server. These three things should work together to run an application in a localhost or local environment.
Wamp is a free server which is only available for windows and Linux operating system. You cant install the wamp server in your mac system.
Follow the below steps to fix the 3306 port issue in WAMP and XAMPP
Step 1: Run your Command prompt as administrator
Step 2: Type “netstat -ano” in the cmd prompt. This will show all the port connections in your network.
Step 3: Now find your port 3306 using find string. Type “netstat -ano | findstr 3306” in cmd prompt and hit enter.
Step 4: Find the listening id of 3306. In my case, 6204 is my listening id. so am going to kill that process id with “taskkill /PID 6204 /F“.
Step 5: Now restart your wamp server.
Now you have fixed your mysql 3306 issue by killing the process using “netstat” commands. Still if you are facing any issues means, please comment below and i will reply back. Happy coding!