Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't connect to MySQL server on localhost (10061) on window 7

I am having window 7 as a operating system in the production machine where i am trying to use MySQL server 5.0 as a database. But i am unable to configure MySQL on my production machine. Following is the error i am receiving.

The security setting could not be applied to the database because the connection has failed with the following error:

Error no. 2003
Can't connect to MySQL server on localhost (10061).

The message also prompts that you need to open TCP 3306 port to resolve this issue, i checked it and found that TCP 3306 port is already opened and state is listening.

This is my 'netstat -an' command result -

Proto   LocalAddress   ForeignAddress   State
TCP     0.0.0.0:3306      0.0.0.0:0           LISTENING

It means TCP at 3306 is open. Can anyone please tell me the solution of this problem. However i am able to install and configure the same MySQL Server setup in window xp. I tried google as well and found a lot of blogs but none is of use.

Thanks a lot.

like image 457
R. Rahul Avatar asked Jul 06 '11 16:07

R. Rahul


People also ask

How do you fix MySQL can't connect to localhost?

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.

Is MySQL compatible with Windows 7?

The MySQL database server is one of the most popular open-source databases in the world. Although administrators typically install MySQL on a server operating system, it's certainly possible to install it on a desktop operating system like Windows 7.

How do I access MySQL server on localhost?

Connecting via a standard connectionEnter 127.0. 0.1 for the host. The default username for a new MySQL installation is root, with a blank password. You can leave the port field blank unless your server uses a different port than 3306.

Could not connect to MySQL with the given password while installing?

Have you tried completely removing the software (from your drive, Firewall, the relevant ProgramData files, the registry), and then reinstalling it? Please do so, reboot your system and try starting the software.


1 Answers

Change

 host: localhost

to

 host: 127.0.0.1

This is likely caused by the way your database is being resolved.

like image 58
stevedbrown Avatar answered Sep 23 '22 14:09

stevedbrown