一、mysql 5.7 on ubuntu 16.04
(1)sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
max_connections=10000
(2)sudo vim /lib/systemd/system/mysql.service
LimitNOFILE=infinity
LimitMEMLOCK=infinity
(3)sudo systemctl daemon-reload
(4)sudo service mysqld restart
二、0x02 mysql 8.0 on ubuntu 20.04
(1)sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
max_connections=10000