Zen Cart Logo
Forums / General Questions / PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

Views: 5,396

Results 1 to 8 of 8
28 Jun 2015, 8:41 PM
#1
whitebear avatar

whitebear

New Zenner

Join Date:
Feb 2011
Posts:
33
Plugin Contributions:
0

PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

Upgraded from v139 to v154 and everything seems to have been working smoothly at v154.

I've noticed at least one time a day I get a set of all the same errors usually within a span of a few seconds. (approximately 85 logs generated using Lat9 debug mod)

In the error logs it repeats but all have the same issue.

#1 mysqli_connect() called at [/xxxx/xxxx/public_html/includes/classes/db/mysql/query_factory.php:62]
#2 queryFactory->connect() called at [/xxxx/xxxx/public_html/includes/init_includes/init_database.php:23]
#3 require(/xxxx/xxxx/public_html/includes/init_includes/init_database.php) called at [/xxxx/xxxx/public_html/includes/autoload_func.php:48]
#4 require(/xxxx/xxxx/public_html/includes/autoload_func.php) called at [/xxxx/xxxx/public_html/includes/application_top.php:158]
#5 require(/xxxx/xxxx/public_html/includes/application_top.php) called at [/xxxx/xxxx/public_html/index.php:26]

[27-Jun-2015 13:29:36 America/Chicago] PHP Warning: mysqli_connect(): (42000/1203): User (removed-on-purose) already has more than 'max_user_connections' active connections in /xxxx/xxxx/public_html/includes/classes/db/mysql/query_factory.php on line 62

28 Jun 2015, 9:08 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

Hmm, me too. I'd put it down to my webhost (1&1) since it's only an occasional burp. Who do you use for your hosting company?

28 Jun 2015, 9:14 PM
#3
whitebear avatar

whitebear

New Zenner

Join Date:
Feb 2011
Posts:
33
Plugin Contributions:
0

Re: PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

bluehost

29 Jun 2015, 3:57 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

You should ask your hosting company what's happening with traffic on your server at that time.
And ask what's the max_user_connections value set to?
It could be that when you're being indexed by search engines it might be generating too much traffic for the way your server is configured.
or maybe your site is being probed maliciously.
Or the server might need some configuration tweaking.

You should really fix those issues before applying the following bandage:
https://www.zen-cart.com/showthread.php?24089-Rotating-Db-Users
Seriously, fix the server configuration, and understand your own traffic patterns, before applying a bandage. Else you'll have much worse problems later.

9 Jul 2015, 2:05 AM
#5
zean avatar

zean

Zen Follower

Join Date:
May 2009
Posts:
200
Plugin Contributions:
0

Re: PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

I too am on Blue Host and very recently upgraded to 1.5.4 and coincidentally threw over 50 identical PHP Warnings in less than 1 minute on July 2.

PHP Warning: mysqli_connect(): (42000/1203): User xxxx_yyyy already has more than 'max_user_connections' active connections in /zzzz/xxxx/public_html/shop/includes/classes/db/mysql/query_factory.php on line 62

So, Whitebear and Lat9, what have you found out?

PS. I do not have any reason to suspect it is a 1.5.4 issue.

Zen Cart v1.5.4
No plugins
Zen Cart installed via FTP and run zc_install
Blue Host Shared Server Apache
PHP Version: 5.2.17 (Zend: 2.2.0)
MySQL 5.5.42-37.1-log

9 Jul 2015, 3:03 AM
#6
zean avatar

zean

Zen Follower

Join Date:
May 2009
Posts:
200
Plugin Contributions:
0

Re: PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

Update: So, I took DrByte's advice and started by looking at my raw access logs. I found for this 1 minute time period all were from the same IP. There was over 350 hits from that IP during the 1 minute. I'm not sure what that means. However, a little googling, etc and I found webmasters have been complaining about that IP for years. The IP is 4.79.204.xx which I have partially masked for privacy reasons. Please check your raw access logs and let me know if you have a similar finding.

Zean:

I too am on Blue Host and very recently upgraded to 1.5.4 and coincidentally threw over 50 identical PHP Warnings in less than 1 minute on July 2.

PHP Warning: mysqli_connect(): (42000/1203): User xxxx_yyyy already has more than 'max_user_connections' active connections in /zzzz/xxxx/public_html/shop/includes/classes/db/mysql/query_factory.php on line 62

So, Whitebear and Lat9, what have you found out?

PS. I do not have any reason to suspect it is a 1.5.4 issue.

Zen Cart v1.5.4
No plugins
Zen Cart installed via FTP and run zc_install
Blue Host Shared Server Apache
PHP Version: 5.2.17 (Zend: 2.2.0)
MySQL 5.5.42-37.1-log

9 Jul 2015, 5:13 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

Zean:

Update: So, I took DrByte's advice and started by looking at my raw access logs. I found for this 1 minute time period all were from the same IP. There was over 350 hits from that IP during the 1 minute. I'm not sure what that means. However, a little googling, etc and I found webmasters have been complaining about that IP for years. The IP is 4.79.204.xx which I have partially masked for privacy reasons. Please check your raw access logs and let me know if you have a similar finding.
@Zean, thanks for making me look, too! I've seen another similar PHP warning on a couple of sites:

PHP Warning:  mysqli_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

At least on one site, the log occurs during a multitude of accesses by ```
Mozilla/5.0 (compatible; MJ12bot/v1.4.5; [url]http://www.majestic12.co.uk/bot.php?+[/url])

9 Jul 2015, 9:04 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PHP Warning: MySQL user already has more than 'max_user_connections' active connectio

Unfortunately don't have the details immediately available, but also in the last week or two saw a similar issue on fatcow. Had 80+ similar messages. ZC 1.5.1.