Can't connect to MySQL server on 'localhost' (10061) after Installation

后端 未结 30 2843
予麋鹿
予麋鹿 2020-12-13 00:08

I installed MySQL using mysql-installer-5.5.20.0.msi on Windows 7. From the cmd window, I run \"mysqlshow -u root -p\". It asked for a password, then return

相关标签:
30条回答
  • 2020-12-13 00:18

    I also faced the same issue and resolved it by below setups:

    1. Check the MYSQL service in the windows service. If it is there and not running then start it. It will solve your problem.

      You can find the services window by navigating to windows Start menu and typing 'services' in the search bar. Select the 'Services' option with the cogs next to it (not the executable file) and the below window will appear. Scroll down to find 'MySql (version)'. When you select MySql you should see an option in the left pane that says 'Start the service'. Click this and a dialogue should appear to indicate Windows is attempting to start the service. Once started the left pane will now give you the option to stop, pause and restart the service and you will now be able to connect to your MySql from the windows cmd line.

    1. If MYSQL service is not present in windows service then follow below setups.

      a. Open cmd as administrator.

      b. cd to C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin

      c. Run the command: C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysqld.exe --install

      d. Check the MySql in the windows service, And if it is not running, Start it by clicking on the service.

      e. If your using XAMMP . Start MySQL at the XAMMP control Panel.


    0 讨论(0)
  • 2020-12-13 00:19

    press Windows+R it opens Run then.. Enter services.msc

    then Find out mysql right click and start

    it works

    0 讨论(0)
  • 2020-12-13 00:19

    Solution 1:

    For 32bit: Run "mysql.exe" from: C:\Program Files\MySQL\MySQL Server 5.6\bin

    For 64bit: Run "MySQLInstanceConfig.exe" from: C:\Program Files\MySQL\MySQL Server 5.6\bin

    Solution 2:

    The error (2002) Can't connect to ... normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.

    The error (2003) Can't connect to MySQL server on 'server' (10061) indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server.

    Source: http://dev.mysql.com/doc/refman/5.6/en/starting-server.html Visit it for more information.

    0 讨论(0)
  • 2020-12-13 00:19

    Most ridiculous thing! I had my VPN connected through STunnel connection type. If you have any VPN make sure they are not messing up your connection.

    0 讨论(0)
  • 2020-12-13 00:20

    I had this error - stupid mistake was, I was using -p3307 to specify port, whereas I should have used -P3307, i.e. capital P. Small 'p' is for password arg :)

    0 讨论(0)
  • 2020-12-13 00:20

    For me, three steps solved this problem on windows 10:

    I downloaded MySQL server community edition zip and extracted it in the D drive. After that I went to bin folder and did cmd on that folder. I followed the below steps and all works:

    D:\tools\mysql-8.0.17-winx64\bin>mysqld -install
    Service successfully installed.
    
    D:\tools\mysql-8.0.17-winx64\bin>mysqld --initialize
    D:\tools\mysql-8.0.17-winx64\bin>net start mysql
    The MySQL service is starting...
    The MySQL service was started successfully.
    
    0 讨论(0)
提交回复
热议问题