简体   繁体   English

MySQL连接('max_user_connections')

[英]MySQL connection ('max_user_connections')

I can not access my database. 我无法访问我的数据库。 I'm getting the following error: 我收到以下错误:

 User 'myuser' has exceeded the 'max_user_connections' resource (current value: 5)

In my PHP code every open connection is closed next. 在我的PHP代码中,每个打开的连接都随后关闭。 And, as I know, when PHP script finishes, the connection is closed automatically. 而且,据我所知,当PHP脚本完成时,连接会自动关闭。

Is there any way to restart the server or close all connections remotely? 有什么办法可以重新启动服务器或远程关闭所有连接?

这应该在Linux上工作以重新启动mysql服务器

sudo /etc/init.d/mysql restart

In MySQL configuration file, set 在MySQL配置文件中,设置

max_connections=200

5 is too low. 5太低。 You will need to restart the server. 您将需要重新启动服务器。 If you can't restart, make this setting in the config file and execute this in the workbench 如果无法重新启动,请在配置文件中进行此设置,然后在工作台中执行

set global max_connections=200

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM