简体   繁体   中英

What do I need to do to get rid of “maximum user connections” error?

I am using MySQLi for my webapp but whenever I want to visit some particular page, I get mysqli_connect() [function.mysqli-connect]: (42000/1203): User ***_user already has more than 'max_user_connections' active connections .

I tried already to close all connections but this does not improve the situation.

Is there a way to know exactly what connections are open at any particular moment or any other useful data that can help me resolve this issue ?

BTW, I'm using PHP 5.2.17 and MySQL 5.1.

You might want to supply us with a little more code.

Use SHOW STATUS WHERE 'variable_name' = 'Threads_connected'; to show you all open connections.

You should always close connections that are not needed anymore. If you work with classes, create __destruct function that closes the connection.

If there is no possibility to close the connection or solution of your problem by closing the connections use set max_user_connections to a number that is at least as high as the number of connections to your db is

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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