Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
1.4k views
in Q2A Core by


Warning: mysql_pconnect() [function.mysql-pconnect]: User 'surakz5_surak' has exceeded the 'max_user_connections' resource (current value: 30) in/home/surakz5/public_html/qa-include/qa-db.php on line 64

 

Could not establish database connection. Please check the username, password and hostname in the config file, and if necessary set up the appropriate MySQL user and privileges.

 

Q2A version: 1.53

2 Answers

0 votes
by

Please try switching off persistent connections in qa-config.php

by
In my settings including persistent connections. I think the problem in the load. When 200-300 onlan site is working properly. But with 500 people online every time out is a mistake maximum user connection.
0 votes
by
edited by

I solved the problem like this. Created 2 user, and for all one password. And these three user has access to one database.

 
 
$style_class = array("new_user1","new_user2");
$random_class = array_rand($style_class, 1);
$div_class = $style_class[$random_class];
 
define('QA_MYSQL_HOSTNAME', 'localhost'); // try '127.0.0.1' or 'localhost' if MySQL on same server
define('QA_MYSQL_USERNAME', $div_class);
define('QA_MYSQL_PASSWORD', 'pass');
define('QA_MYSQL_DATABASE', 'dbname');
...