ERROR 2003 (HY000): Can't connect to MySQL server on localhost (10061)

后端 未结 26 1971
Happy的楠姐
Happy的楠姐 2020-12-23 02:37

I installed MySQL on Microsoft Windows 8 Using a noinstall Zip Archive. But when i tested by executing the following commands on windows prompt, the above error showed up.<

相关标签:
26条回答
  • 2020-12-23 02:52

    I faced the same problem couple of times and each time the reason was different:

    • The solution that worked first time was that by "Abhishek Oza" which is same as that of "amey91" (see above)
    • The second time, my server was on a different port number than the default one(3036),so i was not able to connect.So I had to specify the port number explicitly for making the connection which you can do simply by writing: "mysql --host=127.0.0.1 --port=8081(specify your port number here) mysql -u root -p"
    0 讨论(0)
  • 2020-12-23 02:55

    Hey this is not a big issue what you need to do is.....

    1. Run your cmd as administrator.
    
    2.What you will see is like this
    c:\windows\system32>
    
    3.Go to your bin location by using cd..
    like C:\mysql\bin(my location of bin in my computer is what you are seeing so chose yours correctly)
    
    4.C:\mysql\bin>mysql --install
      Service successfully installed.
    
    5.C:\mysql\bin>NET START MySql
     The MySql service is starting
     The MySql service was started successfully
    

    Then last step is

    6.C:\mysql\bin>mysql -u root - p admin
    It will ask for password don't enter anything first time because it will use blank, n just press enter you are done.
    

    N later you can set password too...:)

    0 讨论(0)
  • 2020-12-23 02:55

    I have tried all the above mentioned options but can not find the solution to this problem . Then I got its solution.... This error is flashed when we are trying to open mysql with out stating the service. Follow the bellow mentioned steps..
    STEP 1
    Open cmd prompt
    to start the service type
    mysqld --console this will start the mysql service
    enter image description here
    STEP 2 dont close this cmd prompt
    now open new cmd prompt and type
    mysql -u root -p
    then enter ur password
    enter image description here

    0 讨论(0)
  • 2020-12-23 02:56

    I will advise to use first check if my.ini exist in mysql folder in c drive or in windows folder mysqld -install (Service successfully installed) mysqld --initialize (no prompt) Also another advise is not to use mysql 8, since it is not compatible with wordpress or any other opensource yet, there are lot of changes between version 5 and version 8, so if you are using mysql please use version 5.x.

    0 讨论(0)
  • 2020-12-23 02:57

    Well that could have some reasons.

    THe first one is that the MySQL server/service not started.

    If he is started you should check out the logfiles, and make sure there are no problems.

    You could also uninstall the MySQL service and install XAMPP. With XAMPP it is easier to manage this services.

    0 讨论(0)
  • 2020-12-23 03:03

    Test if the server is running. You can use netstat for this. See https://serverfault.com/questions/260239/unable-to-connect-to-mysql-through-port-3306

    If it is running, it may be the firewall. You can turn that off to test if that is the problem.

    See the following manual to install Mysql as a service: https://dev.mysql.com/doc/refman/5.5/en/windows-start-service.html

    0 讨论(0)
提交回复
热议问题