top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to change max simultaneous connection parameter in mysql.

+1 vote

I am using PHP along with mysql. Mysql default configuration allows to have 100 simultaneous connection which I want to chane to 200. Please help.

posted Mar 16, 2013 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

+1 vote
Best answer
cat /etc/my.cnf | grep connections
max_connections = 300 
answer Mar 16, 2013 by anonymous
+2 votes

mysql -uroot -pxxxxxxx -se "show variables" | grep max_connections
max_connections 151

Defualt value:- 151
Range :- 1 to 100000

You change these things in 3 ways:-
1) Using my.cnf
Default options are read from the following files in the given order:
a) /etc/my.cnf
b) /etc/mysql/my.cnf
c) /usr/etc/my.cnf
d) ~/.my.cnf
You have to put "max_connections" field name under [mysqld] heading...
2) you can pass this as a parameter to mysqld process
3) you can changes this value in mysql console as well
mysql> select @@global.max_connections;
| @@max_connections |
| 151 |
1 row in set (0.00 sec)
mysql> set @@global.max_connections=152;
Query OK, 0 rows affected (0.00 sec)
1 row in set (0.00 sec)
if we change like this when you restart mysql, it will fallback to default value.


answer Jun 28, 2013 by Azad Nikarthil
Similar Questions
0 votes

My site is using mysql and PHP, now for the scale purpose want to introduce mysql-cluster. Few questions are -
1. Do I need to change any code which is written in PHP.
2. What are the steps to convert mysql to mysql-cluster.

Appreciate the help.

0 votes

warning mysql_fetch_array() expects parameter 1 to be resource boolean given in

Could the experts please comment on this, and offer some advice? Thanks a lot.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.