Mysql中too many connections问题
2007-10-24 10:57
447 查看
Mysql中too many connections问题的解决
关键字: mysql
使用mysql,经常碰到too many connections的报错,登录不上去,只能重新启动。通过如下的方法可以解决这个问题:
1。首先修改/etc/my.cnf文件,增加如下一行
set-variable = max_connections=500
或在启动命令中加上参数 max_connections=500
就是修改最大连接数,然后重启mysql.默认的连接数是100,太少了,所以容易出现如题错误.
2。重新启动mysql,通过show variables可以查看max_connections是否修改成功。
3。为了防止发生too many connections时候无法登录的问题,mysql manual有如下的说明:
mysqld actually allows max_connections+1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege. By granting the SUPER privilege to administrators and not to normal users (who should not need it), an administrator can connect to the server and use SHOW PROCESSLIST to diagnose problems even if the maximum number of unprivileged clients are connected.
因此, 必须只赋予root用户的SUPER权限,同时所有数据库连接的帐户不能赋予SUPER权限。前面说到的报错后无法登录就是由于我们的应用程序直接配置的root用户
关键字: mysql
使用mysql,经常碰到too many connections的报错,登录不上去,只能重新启动。通过如下的方法可以解决这个问题:
1。首先修改/etc/my.cnf文件,增加如下一行
set-variable = max_connections=500
或在启动命令中加上参数 max_connections=500
就是修改最大连接数,然后重启mysql.默认的连接数是100,太少了,所以容易出现如题错误.
2。重新启动mysql,通过show variables可以查看max_connections是否修改成功。
3。为了防止发生too many connections时候无法登录的问题,mysql manual有如下的说明:
mysqld actually allows max_connections+1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege. By granting the SUPER privilege to administrators and not to normal users (who should not need it), an administrator can connect to the server and use SHOW PROCESSLIST to diagnose problems even if the maximum number of unprivileged clients are connected.
因此, 必须只赋予root用户的SUPER权限,同时所有数据库连接的帐户不能赋予SUPER权限。前面说到的报错后无法登录就是由于我们的应用程序直接配置的root用户
相关文章推荐
- 怎样解决mysql的too many connections问题?
- MySQL 1040 Too many connections 问题解决
- MySQL中too many connections问题解决
- mysql too many open connections问题解决方法
- 找到一篇比较全面的解决mysql最大连接数Too many connections问题的帖子
- Mysql Too Many Connections问题解决
- Mysql Too many connections问题
- Too many connections:解决mysql连接数过多的问题
- Mysql Too Many Connections问题解决
- 如何优化Linux下MySQL 5.0【涉及discuz论坛数据库too many connections问题】
- 解决小小书屋网访问时MySQL连接问题:Too many connections
- mysql5.6 too many connections问题解决及其他参数设置
- SpringMVC中普通类里获取自动注解bean衍生出Mysql报Too many connections错误的问题
- mysql too many open connections问题解决方法
- mysql Too many connections
- Nova报错:OperationalError: (_mysql_exceptions.OperationalError) (1040, 'Too many connections')
- 解决mysql 1040错误Too many connections的方法
- mysql的max_connections和Too many connections
- Mysql too many connections
- mysql "too many connections" 错误 之 mysql解决方法