1、问题:mysql 报错1040:too many connections。

2、解决办法:

  1. WIN+R 在运行命令框中输入services.msc。
  2. 找到mysql服务,重新启动。
  3. WIN+C在运行命令框中输入cmd。
  4. 在DOS环境中输入mysql -u用户名 -p密码,按回车键进入mysql。
    mysql 1040: too many connections错误
  5. 执行show variables like “max_connections”; 查看最大连接数。
    mysql 1040: too many connections错误
  6. 执行set GLOBAL max_connections=1500; 设置最大连接数。
    mysql 1040: too many connections错误
  7. 再次执行show variables like “max_connections”; 查看最大连接数是否已经更改。
    mysql 1040: too many connections错误
  8. 执行exit,退出mysql。

相关文章: