标题: Can't connect to MySQL server on 'localhost' (10061)Errno.: 2003解决方案 [打印本页] 作者: superadmin 时间: 2008-6-19 08:40 标题: Can't connect to MySQL server on 'localhost' (10061)Errno.: 2003解决方案 服务器提示:Can not connect to MySQL server 即无法连接到MySQL服务器
错误信息:Can't connect to MySQL server on 'localhost' (10061)
即不能连接到MySQL服务器'本机 ' ( 10061 )
errno 。 : 2003
搜索了一下资料,别的网友说因为数据库连接超过最大连接数,MySQL数据库服务停止了。
根据提示信息判断这台机器上没提供MySQL服务, 需要从新启动这台机器上的MySQL服务即可。
重启之前在My.ini中查找max_connections 修改连接数为1000 保存后在重启。
有时遇到MySQL无法启动,很可能是My.ini出错,若没有My.ini文件,可以自己创建一个,一般都创建在在winnt目录下(不同系统,目录不同,但都在windows安装目录)。
My.ini文件完整内容:
#This File was made using the WinMySQLAdmin 1.4 Tool
#2002-8-4 23:10:46
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
# Example mysql config file.
# Copy this file to c:\my.cnf to set global options
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options
# This will be passed to all mysql clients
[client]
#password=my_password
port=3306
#socket=MySQL
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# The MySQL server
[mysqld]
port=3306
#socket=MySQL
skip-locking
default-character-set=gbk
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K
set-variable = flush_time=1800
# Uncomment the following row if you move the MySQL distribution to another
# location
#basedir = d:/mysql/