FORUM HOME | WHUK BLOG   
WEB HOSTING UK AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM
PHP LINUX SHARED HOSTING WINDOWS ASP.NET HOSTING PACKAGES
ECOMMERCE HOSTING ASP MSSQL MS ACCESS ODBC FRONTPAGE HOSTING
CPANEL WHM FANTASTICO RESELLER DEDICATED SERVER WEB HOSTING
CHEAP PLESK CPANEL HTML MYSQL BEST UK VPS HOSTING COMPANY
CHEAP RELIABLE UK HOSTING PROVIDER SINCE 2001
MANAGED WEB HOSTING SERVICE
AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM

Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum » Technical Support » Linux Dedicated Servers

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 05-01-11, 02:58 PM
Moderator
 
Join Date: Oct 2009
Posts: 30
Thumbs up max_user_connections errors

max_user_connections errors

max_user_connections error is related to MySQL. Server gives 'Too Many Connections' error whenever there is no room in the connection pool for the new connection objects. Hence, each company limit this connection on their server specification.

Error :

Warning: mysql_connect(): User cpaneluser_databaseuser has already more than 'max_user_connections' active connections in /home/username/public_html/script.php on line xxxx

User cpaneluser_xxx has already more than 'max_user_connections' active connections

Correction :

The settings are located in the /etc/my.cnf

We can set or manage the limit from here editing file my.cnf

Quote:
max_user_connections = 20

you can change it

max_user_connections =30
On shared server we implies a concurrent connections per mysql user limit on script to prevent heavy mysql load on the server and to hunt down scripts that use unnecessary mysql connections due to bad coding practices.

Prevention

These errors can be prevented by some coding tweaks into your script.

[i] Use of mysql_connect() for connections to mysql dbs in your code. The advantage is :

"The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close()."



[ii] Use function mysql_close() explicitly. Although mysql_connect() closes the connections, use of mysql_close() in conjunction with it would make sure that the connection is totally closed.

[iii] Don't use mysql_pconnect(). The mysql_pconnect is disabled on server.

"The connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect)"



You can also refer :

PHP: mysql_connect - Manual
PHP: mysql_close - Manual
PHP: mysql_pconnect - Manual
Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT. The time now is 09:00 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright 2001-2010 Web Hosting UK. All rights reserved.
Web Hosting UK Forum





Site Map

Shared Cloud
Shared Cloud From £1

Affiliate Program
Earn up to £300 Per Sale

Dedicated Servers
Dedicated Server Hosting

Cloud Hosting
Cloud Server Hosting

Load Balanced Server
Load Balancing Server

VPS Hosting
Linux VPS Hosting

Windows VPS
Windows 2003 VPS

Zimbra Hosting
Zimbra Email Hosting

cPanel Hosting
Shared Linux Hosting

Windows Hosting
Shared Windows Hosting

Coldfusion Hosting
Windows Coldfusion Hosting

cPanel Reseller Hosting
Reseller Hosting

Windows Reseller
Windows Reseller Hosting

Email Web Hosting
Email Hosting

Semi-Dedicated Server
Semi-Dedicated Hosting

Remote Backup Plans
Offsite Backup Service


cpanel hosting
Knowledgebase Articles

Pre-Sales Question
Web Hosting FAQ's

Dedicated Hosting
Dedicated Server FAQ's

Virtual Private Servers
VPS Hosting

PHP MySQL Hosting
cPanel Hosting

Windows Hosting
ASP MSSQL Hosting

Domain Name
Domain registration FAQ's

CMS Hosting
CMS Hosting FAQ's

Payment Gateways
Payment FAQ's


Support Tutorials

cPanel Tutorials
cPanel Flash Tutorials

Wordpress Tutorials
Wordpress Flash Tutorials

Plesk Tutorials
Plesk Flash Tutorials

PhpMyadmin Tutorials
PhpMyadmin Flash Tutorials

Drupal Tutorials
Drupal Flash Tutorials

Mambo Tutorials
Mambo Flash Tutorials

Joomla Tutorials
Joomla Flash Tutorials

More Hosting Tutorials