others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

mariadb与mysql常见故障汇总

访问量:1370 创建时间:2021-08-26

Too many connections

[root@e ~]# mysql -uroot -p
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 15558112
Server version: 10.1.46-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show variables like '%max_connections%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| extra_max_connections | 1     |
| max_connections       | 151   |
+-----------------------+-------+
MariaDB [(none)]> set GLOBAL max_connections=1000; 
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> show variables like '%max_connections%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| extra_max_connections | 1     |
| max_connections       | 1000  |
+-----------------------+-------+

修改配置文件

[root@ecs-meiyun ~]# vim /etc/my.cnf.d/server.cnf 
[mysqld]
#增加下面的配置
max_connections = 1000   
登陆评论: 使用GITHUB登陆