无法在 Windows XP 上连接到本地主机 (10061) 上的 MySQL 服务器。连接到mysql时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10605013/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't connect to MySQL server on localhost (10061) on window XP. Error connecting to mysql
提问by user1074122
I'm using mysql 5.0 and easyphp. While connecting to sql server I'm receiving the above error. When I tried to check the connection with
我正在使用 mysql 5.0 和 easyphp。在连接到 sql server 时,我收到上述错误。当我尝试检查与
telnet localhost 3306
it says
它说
could not open connection to the host. connection failed.
无法打开与主机的连接。连接失败。
What should I do now? I've already turned off my firewall.
我现在该怎么办?我已经关闭了我的防火墙。
回答by Michael Seibt
Are you sure that mysql is running? Is it possible that you have skip_networking in your configuration file? See:
你确定mysql正在运行?您的配置文件中是否有skip_networking?看:
http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html
http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html
[SOURCE: http://lists.mysql.com/mysql/186288]
[来源:http://lists.mysql.com/mysql/186288]
回答by user1403625
Open my.ini
file from mysql/bin/
my.ini
从打开文件mysql/bin/
And remove hash (#
) from line #bind-address="127.0.0.1"
并#
从行中删除哈希 ( )#bind-address="127.0.0.1"
If that line doeasn't exist, paste bind-address="127.0.0.1"
in [mysqld]
part.
如果该行doeasn't存在,粘贴bind-address="127.0.0.1"
的[mysqld]
部分。
Restart mysql and everything should be working again.
重新启动 mysql,一切都应该可以正常工作了。
[SOURCE: easyphp faq]
[来源:easyphp 常见问题]
回答by Dav T.
Make sure you have MySql Server installed in running in your machine or get it from http://dev.mysql.com/downloads/file/?id=460602That is how i solved the same problem.
确保你的机器上安装了 MySql Server,或者从http://dev.mysql.com/downloads/file/?id=460602获取它, 这就是我解决同样问题的方法。
Please remember to configure to the port number corresponding to the one one you used for your database application(3306 is the common one)
请记得配置为你的数据库应用所使用的端口号对应的端口号(3306是常用的)
The password you entered when configuring MySQL Server should be the one you use to connect to your database(and it shouldn't be NULL)
你在配置 MySQL 服务器时输入的密码应该是你用来连接到数据库的密码(并且它不应该是 NULL)