mysql> show status like 'Threads%'
-> ;
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_cached | 7 |
| Threads_connected | 16 | ##這個數值指的是打開的連接數
| Threads_created | 812 |
| Threads_running | 2 | ##這個數值指的是激活的連接數
+-------------------+-------+
4 rows in set
mysql> show variables like '%max_connections%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| max_connections | 1000 | 這是當前設置的最大連接數
| mysqlx_max_connections | 1000 |
+------------------------+-------+
2 rows in set
可以在/etc/my.cnf里面設置數據庫的最大連接數
max_connections = 1000