问题
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.
回答1:
Change
host: localhost
to
host: 127.0.0.1
This is likely caused by the way your database is being resolved.
回答2:
have you checked whether the port 3036 is already in use by another application?
Have you checked whether a telnet hostname
3036 works on the local MySQL server and also on the remote machine?
回答3:
First check in the system, MySQL services is in running condition or not. look out on path of services go to right click on My Computer > manage > Services and Application > Services and check MySQL service status is started or not. Otherwise right click on service and start to service.
I hope this will help you.
回答4:
I didn't find the MySQL services even after solving the problem.
I just run the mysqld
as administrator and the problem is solved. So, simple but It took me 3 hours to find the solution.
回答5:
The problem was rsolved. The MySQL was not running in the Services section of Settings. Because XAMMP had disconnected the already running application in the background.
来源:https://stackoverflow.com/questions/6599524/cant-connect-to-mysql-server-on-localhost-10061-on-window-7