Can't connect to MySQL server on '127.0.0.1' (10061) (2003) [closed]
Asked Answered
M

10

81

I know this question was asked a lot before but I tried some of the solutions which were given and nothing worked.

I have downloaded MySQL Workbench 6.1 on my windows 7 x64 and now as I want to start and do a simple DB I set a new MySQL Connection and let it as default the Hostname, port and the username I just set the name of the connection. In the beginning it was showing down in the action output that Could not connect. Server may not be run and in the msg part it was written Can't connect to MySQL server on '127.0.0.1' (10061) but I thought I would be able to do a DB and test it Then I created simple DB and when I wanted to execute it I couldn't press the Bolt which execute the DB so I tried from Query and I pressed the 2nd option which is "Execute(All or Selection) to text" as I couldn't choose any other option and this error was shown Can't connect to MySQL server on '127.0.0.1' (10061) (2003)

I am new in this I have used SQL*Plus for a while but it is not the same.

Modernism answered 2/7, 2014 at 7:52 Comment(5)
Looks like the mysql serveer is not started.Guyton
ya it seems so, so how can I start it?Modernism
Look to the [official documentation] (dev.mysql.com/doc/refman/5.5/en/windows-start-service.html) of MySQLGuyton
Check here (rathishkumar.in/2017/08/…) for all possible reasons and workaround for this errorIllaffected
This problem generally arises if your XAMPP server is not started untill you hit start. first start XAMPP server then start mysql toolFancie
G
57

Looks like the mysql server is not started.

Look to the official documentation of MySQL how you can start a service under windows.

Install the server as a service using this command: C:> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --install

Guyton answered 3/7, 2014 at 8:10 Comment(4)
its keeps saying install/remove deniedCareerism
@Downvoter: Please explain why else it is not usefullGuyton
Some time might be your server has been started but your host/IP will be different. So need to check ip as well. It happened in my case. then i run MySQLInstanceConfig.exe and just follwed the instruction which told me the current ip configured.Bowel
@Careerism try to run CMD as an AdminAlberic
T
96

If you have already installed MySQL on a windows machine make sure it is running as a service.. You can do that by

Start --> services --> MySQL(ver) --> Right-Click --> Start

Towrey answered 27/10, 2016 at 6:59 Comment(2)
Is there another "easier" method to start the server?Unavailing
This is the easiest most basic thing to check first. I can't understand why people are keep on debugging complex stuffViewpoint
G
57

Looks like the mysql server is not started.

Look to the official documentation of MySQL how you can start a service under windows.

Install the server as a service using this command: C:> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --install

Guyton answered 3/7, 2014 at 8:10 Comment(4)
its keeps saying install/remove deniedCareerism
@Downvoter: Please explain why else it is not usefullGuyton
Some time might be your server has been started but your host/IP will be different. So need to check ip as well. It happened in my case. then i run MySQLInstanceConfig.exe and just follwed the instruction which told me the current ip configured.Bowel
@Careerism try to run CMD as an AdminAlberic
P
41

I was facing the same problem, but what I did not realise is that I did not have the MySQL Server installed. You must simply install the MySQL Server.

In order to install the MySQL server, you must run the "MySql Installer" and then press the "Add" button and then choose the "MySQL Server" in the tree.

After doing that, run you workbench again and you'll notice that there'll already be a connection configured. Hopefully, you'll be able to create a new connection or as many connections as you want.

Phylis answered 2/2, 2015 at 11:28 Comment(1)
saved my life in 2022 :) really strange that it's not clearer in the actual installation flow but hey thanks! worked for me..Haugh
M
30

(Windows) If you have already installed MySQL server

cd C:\Program Files\MySQL\MySQL Server X.X\bin mysqld --install

and still cannot connect, then the service did not start automatically. Just try

Start > Search "services"

and scroll down until you see "MySQLXX", where the XX represents the MySQL Server version. If the Status isn't "Started", then

Right Click > Start

If you are here you should be golden: enter image description here

Meliorate answered 30/1, 2018 at 21:21 Comment(0)
I
16

In Windows goto task-manager >"services" and check that "MySQL" is runing. If not
Right click on it ->open services->MySQL-> startup type -> 'Automatic' -> apply and OK. this is for windows 10 MySql 5.7

Intercept answered 22/2, 2017 at 12:16 Comment(0)
P
7

I solved the problem as follows:

  1. run MySQLInstanceConfig.exe

    C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\MySQLInstanceConfig.exe

  2. Follow to the end without changing anything.

Precedential answered 27/10, 2014 at 0:43 Comment(1)
I am using MySQL Server 8.0 and the executable does not exist.Katrinka
I
5

maybe it has a different solution, but I fixed it by finding mysqld.exe and running following command in the console:

C:\wamp\bin\mysql\mysql5.6.17\bin\mysqld.exe --console

You should be able to see following result:

enter image description here

Ious answered 16/4, 2016 at 0:33 Comment(0)
S
3

Avoid using bind_address in your my.cnf file, if you have any.

Ref: http://dev.mysql.com/doc/refman/5.5/en/can-not-connect-to-server.html

Schiro answered 15/10, 2015 at 23:35 Comment(1)
This answer helped me. Because my MySql service was already running. My IP was allowed to connect to server with mysql client. But in /etc/my.cnf file "bind_address" was 127.0.0.1. That I removed to resolve the problem. and restarted mysql service and here I am now able to connect with mysql server using mysql client. Tone of thanksTears
M
2

In my case, I had installed a new installation of MYSQL(8) and WORKBENCH etc. so that I could then work on an old WordPress website. No matter what I did, it wouldn't work. Kept getting "ERROR ESTABLISHING CONNECTION" etc. Thinking that it was maybe something to do with WordPress(since it is old), I tried a basic manual connection with PHP and nothing.

Eventually, I figured out that I had to downgrade MySQL. So I went back to MYSQL installer, found the server, and downgraded MYSQL from 8.0 back to 5.5

As soon as I did that, everything worked.

Master answered 29/6, 2019 at 16:1 Comment(1)
I had the same problem. It was not connecting. I followed your advice and also downgraded it to 5.5. Its now working perfectly. Thanks.Nard
G
1

Resolved this issue by navigating to C:\xampp\mysql\bin and double clicking on mysqld.exe and then allow access in the pop up that comes. My server status on workbench changed to running.

Gulfweed answered 10/6, 2019 at 10:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.