我遇到了一个问题,在MySQL max_connction的值是214后,我通过编辑设置1000 my.cnf中,就像如下:
hadoop@node1:~$ mysql -V
mysql Ver 14.14 Distrib 5.7.15, for Linux (x86_64) using EditLine wrapper
Run Code Online (Sandbox Code Playgroud)
MySQL版本:5.7
操作系统版本:ubuntu 16.04LTS
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set (0.00 sec)
Run Code Online (Sandbox Code Playgroud)
我们可以看到,max_connections的变量值是151.然后,我编辑MySQL的配置文件.
yang2@node1:~$ sudo vi /etc/mysql/my.cnf
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
max_connections=1000
Run Code Online (Sandbox Code Playgroud)
保存混淆后重启MySQL服务.
yang2@node1:~$ service mysql restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'mysql.service'.
Multiple identities can be used for authentication:
1. yangqiang,,, (yang2)
2. …Run Code Online (Sandbox Code Playgroud)