多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 1. 信息查询 ### 1.1 最大连接数 #### 1.1.1 查询 ~~~ mysql> show global variables like 'max_conn%'; +--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | max_connect_errors | 100 | | max_connections | 5000 | +--------------------+-------+ 2 rows in set (0.00 sec) ~~~ #### 1.1.2 修改 1 my.conf,需要重启! ~~~ max_connection = 1000; ~~~ 2. 动态修改 还可以进入数据库 ~~~ mysql> set GLOBAL max_connections=200 ~~~ 显示当前运行的Query: ~~~ mysql> show processlist; +---------+--------+-----------+------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +---------+--------+-----------+------+---------+------+-------+------------------+ | 2909679 | manage | localhost | NULL | Query | 0 | init | show processlist | +---------+--------+-----------+------+---------+------+-------+------------------+ 1 row in set (0.00 sec) ~~~ 显示当前状态:mysql> show status 退出客户端:mysql> exit > 这种方法设置后,只是暂时的,数据库重启后,会变为原来的数值,要想永久,设置完后修改配置文件my.cnf,避免重启后失效。 show variables like '%pid%'; ### 1.3 当前连接数 ~~~ mysql> show status like 'Threads%'; +-------------------+-------+ | Variable_name | Value | +-------------------+-------+ | Threads_cached | 13 | | Threads_connected | 51 | | Threads_created | 94 | | Threads_running | 1 | //当前连接数 +-------------------+-------+ 4 rows in set (0.01 sec) ) ~~~