mysql error 2005 - Unknown MySQL server host 'localhost'(11001)

后端 未结 3 2385
不知归路
不知归路 2020-12-06 06:30

I was using mysql 5.6.11,it usually turned down and show me this:

2005 - Unknown MySQL server host \'localhost\'(11001).

Current

3条回答
  •  有刺的猬
    2020-12-06 06:51

    The case is like :

     mysql connects will localhost when network is not up.
     mysql cannot connect when network is up.
    

    You can try the following steps to diagnose and resolve the issue (my guess is that some other service is blocking port on which mysql is hosted):

    1. Disconnect the network.
    2. Stop mysql service (if windows, try from services.msc window)
    3. Connect to network.
    4. Try to start the mysql and see if it starts correctly.
    5. Check for system logs anyways to be sure that there is no error in starting mysql service.
    6. If all goes well try connecting.
    7. If fails, try to do a telnet localhost 3306 and see what output it shows.
    8. Try changing the port on which mysql is hosted, default 3306, you can change to some other port which is ununsed.

    This should ideally resolve the issue you are facing.

提交回复
热议问题