top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to change max simultaneous connection parameter in mysql.

+1 vote
676 views

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 LinkedIn 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
--max_delayed_threads=300
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.

Reference:-
http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_connections

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

I am running My-SQL in cluster mode with two machine. Want to know if mysql database get corrupted on one of the machine will it force the corruption on the other machine too or in this case sync between two mysql instances will stop after the corruption.

0 votes

To source sqldump i can use the source command, but if I need to do the same stuff using command line without going to the sqlpromt, can I achieve that.

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.

...