[Email protected] ~]# mysql-s/var/lib/mysql/mysql.sockerror 1040 (HY000): Too Many connections
Use the GDB command to make changes to MySQL's max_connections:
[[email protected] ~]# gdb -p $ (cat /var/ Run/mysqld/mysqld.pid) -ex "set max_connections=500" -batch[new lwp 25797][new lwp 25794][new lwp 25793][new lwp 25792][new lwp 25791][new lwp 25790][New LWP 25789][New LWP 25788][New LWP 25787][New LWP 25786][new lwp 25785][new lwp 25783][new lwp 25782][new lwp 25781][new lwp 25780][new lwp 25779][new lwp 25778][new lwp 25777][new lwp 25776][new lwp 25775][new lwp 25774][thread debugging using libthread _db enabled]using host libthread_db library "/lib64/libthread_db.so.1". 0x00007f2e646f1b7d in poll () from /lib64/libc.so.6
[[email protected] ~]# mysql -s /var/lib/mysql/mysql.sockenter password: Welcome to the mysql monitor. commands end with ; or \ g.your mysql connection id is 4server version: 5.6.30 mysql community server (GPL) copyright (c) 2000, 2016, oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of oracle corporation and/or Itsaffiliates. other names may be trademarks of their respectiveowners . type ' help; ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> show variables like ' max_connections '; +-----------------+------- +| variable_name | value |+-----------------+-------+| max_connections | 500 |+-----------------+-------+1 row in set (0.00 sec) mysql>
This article from "candon123" blog, declined reprint!
Troubleshooting for Mysql "Too many connections"