当前位置:Gxlcms > 数据库问题 > Troubleshooting For Mysql "Too many connections"

Troubleshooting For Mysql "Too many connections"

时间:2021-07-01 10:21:17 帮助过:2人阅读

[root@zabbix ~]# mysql -S /var/lib/mysql/mysql.sock
ERROR 1040 (HY000): Too many connections

使用gdb命令对mysql的max_connections进行更改:

[root@zabbix ~]# 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
[root@zabbix ~]# mysql -S /var/lib/mysql/mysql.sock
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server 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 its
affiliates. Other names may be trademarks of their respective
owners.

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>

本文出自 “candon123” 博客,谢绝转载!

Troubleshooting For Mysql "Too many connections"

标签:mysql

人气教程排行