skip to Main Content

I have encountered a strange error with MySQL service. I can not start it due to the problem related to ports. I have checked my error logs:

2021-03-18T10:02:22.507114Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address
2021-03-18T10:02:22.507246Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-18T10:02:22.508080Z 0 [ERROR] [MY-010119] [Server] Aborting

I have checked some other threads on StackOverflow about this issue, so I decided to try the solutions.

I checked all my ports with:

netstat -tulpn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:12526           0.0.0.0:*               LISTEN      485/sshd
tcp        0    232 172.16.2.34:12526       10.200.0.62:62217       ESTABLISHED 898/sshd: sop [priv
tcp6       0      0 :::80                   :::*                    LISTEN      547/apache2

As you can see, there is nothing associated with port 3306.
To be sure, I checked that with:

lsof -i TCP:3306

I decided to try changing the port that MySQL uses. I opened the configuration file and changed the port to the different one that FOR SURE must be free (again, I checked that).

port = 6606

Unfortunately, it only resulted into changed error log:

2021-03-18T10:22:22.507114Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address
2021-03-18T10:22:22.507246Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 6606 ?
2021-03-18T12:02:22.508080Z 0 [ERROR] [MY-010119] [Server] Aborting

All solutions I have seen, require to kill the program that occupy the port, but how do I am supposed to do so when there is no such program? What else can I consider? I wonder if I will just end up with reinstalling MySQL, because I have no idea what to do with this error…

I would like to admit that MySQL has worked very well so far, and I cannot pinpoint why it suddenly stopped working properly. No significant changes have been made to the system. No services were installed that could started to use ports that MySQL wants to use.

I use MySQL on Linux Debian 10.

Thank you in advance for all your help and time. 🙂

4

Answers


  1. Chosen as BEST ANSWER

    After more researches and efforts, I decided to fully reinstall MySQL service, because I did not find anything working. Now everything is working fine, but I hope that I will not encounter something hopelessly similar in the future.


  2. Check the MySQL service status by running below command:

    /etc/init.d/mysqld status

    If MySQL service is running then stop the service by running below command

    /etc/init.d/mysqld stop

    Check if MySQL service port 3306 is still in use or not by running below command:

    netstat -apn | grep 3306

    If MySQL service is found running in step 3 then kill the service using below command:

    kill -9 pid

    Start the MySQL service using below command:

    /etc/init.d/mysqld start

    Login or Signup to reply.
  3. I had the same problem that port 3306 was not in use but I couldn’t start mysql server.

    I am first time istalling MySQL Cluster so I followed this guide: https://devops-fu.org/2018/08/13/how-to-install-mysql-ndb-cluster-ubuntu/

    It came out that the mysql didn’t have access to following folders:

    /var/lib/mysql
    /var/log/mysql
    /var/run/mysql
    

    Maybe I was running installation commands using wrong user account.

    Login or Signup to reply.
  4. I had this problem on my local WampServer (in Windows 10), after hours of try to solve it, I found very simple solution!
    Just open Task Manager by keeping "Ctrl" + "Alt" + "Delete" keys, then search for "mysqld.exe" process, right-click on it and click "End Task".
    Restart the WampServer and enjoy it!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search