ITeye博客

MySQL 1040 错误 Too many connections

ycjunhua · 2009-04-12 22:43 · mysql · Markdown

Can not connect to MySQL server Error: Too many connections Errno.: 1040

原因:

因为 my.ini 中设定的并发连接数太少或者系统繁忙导致连接数被占满。

解决方式:

打开 MYSQL 安装目录打开 my.ini 找到 max_connections 默认是 100, 一般设置到500~1000比较合适,重启 MySQL ,解决 MySQL 1040 错误。

高手优化的MYSQL my.ini的1000人在线配置。

#This File was made using the WinMySQLAdmin 1.4 Tool #2004-2-23 16:28:14 #Uncomment or Add only the keys that you know how works. #Read the MySQL Manual for instructions

basedir=D:/mysql #bind-address=210.5.. datadir=D:/mysql/data #language=D:/mysql/share/your language directory #slow query log#= #tmpdir#= #port=3306 set-variable = max_connections=1000 skip-locking #skip-networking set-variable = key_buffer=384M set-variable = max_allowed_packet=1M set-variable = table_cache=512 set-variable = sort_buffer=2M set-variable = record_buffer=2M set-variable = thread_cache=8

Try number of CPU’s*2 for thread_concurrency

set-variable = thread_concurrency=8 set-variable = myisam_sort_buffer_size=64M #set-variable = connect_timeout=5 #set-variable = wait_timeout=5 server-id = 1

set-variable = key_buffer=128M set-variable = sort_buffer=128M set-variable = read_buffer=2M set-variable = write_buffer=2M

set-variable = key_buffer=128M set-variable = sort_buffer=128M set-variable = read_buffer=2M set-variable = write_buffer=2M

Server=D:/mysql/bin/mysqld-nt.exe 重启一下MYSQL服务就OK了

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。