测试环境的连接满了,连root用户都无法登录了。但是开发又不愿意现在就重启系统。MySQL通常会为SUPER用户保留一个连接,但是如果应用程序以SUPER用户的身份进行连接,这无济于事了。而这个测试环境用的就是root做测试的。只好借助gdb来临时调大连接数:
# gdb -p $(cat /usr/local/mysql/data/mysqldb.pid) -ex "set max_connections=2500" -batch [New LWP 4458] [New LWP 4456] [New LWP 4455] [New LWP 4454] [New LWP 4453] [New LWP 4452] [New LWP 4451] [New LWP 4450] [New LWP 4449] [New LWP 4448] [New LWP 4447] [New LWP 4446] [New LWP 4445] [New LWP 4444] [New LWP 4443] [New LWP 4440] [New LWP 4439] [New LWP 4438] [New LWP 4437] [New LWP 4436] [New LWP 4435] [New LWP 4434] [New LWP 4433] [New LWP 4432] [New LWP 4431] [New LWP 4430] [New LWP 4429] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". 0x00007f41a6adbddd in poll () from /lib64/libc.so.6 [Inferior 1 (process 4428) detached]
或者这样:
# gdb -p $(pidof mysqld) -ex "set max_connections=2500" -batch