Knowledgebase

>> Portal Home > Knowledgebase > PHP and scripts > Max User Connections


Max User Connections

max_user_connections error - This error means that you are trying to create too many connections to the database at the same time. Another words this may mean that you have a lot of traffic on your site.

Every shared server shares, apart  from disk space, also connections to Mysql. If you believe your site started to receive enormous amount of traffic, suggested solution to this is to rent dedicated server instead of shared one.

If you believe your site doesn't receive that much traffic then problem may be in your php code. Your code may be opening a new connection constantly causing you problems.

For this reason we suggest to check your php code. You may want to run mysql_reconnect command before each query. Also add command mysql_close() at the end of your script to close all open connections.

If you would like your page site viewers be transferred onto another site, when this type of error occurs, you can use following code:

 

$link = mysql_connect("localhost", "mysql_user", "mysql_password");

if (mysql_errno() == 1203) {

// 1203 == ER_TOO_MANY_USER_CONNECTIONS (mysqld_error.h)

header("Location: http://www.your-website.com/another_temporary_page.php");

exit;

}

?>



Was this answer helpful?

Also Read

Powered by WHMCompleteSolution

Language: