mysql数据库-6-3-Mysql查看连接数(连接总数、活跃数、最大并发数)

怎么查看mysql的最大连接数

show variables like '%max_connection%'; 查看最大连接数
set global max_connections=1000;        重新设置最大连接数

怎么查看mysql的已经连接数

mysql> show status like  'Threads%';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| Threads_cached    | 32    |
| Threads_connected | 10    |
| Threads_created   | 50    |
| Threads_rejected  | 0     |
| Threads_running   | 1     |
+-------------------+-------+

Threads_connected :这个数值指的是打开的连接数.
Threads_running :这个数值指的是激活的连接数,这个数值一般远低于connected数值. 准确的来说,Threads_running是代表当前并发数
Threads_connected 跟show processlist结果相同,表示当前连接数。

怎么查看mysql的日志路径

日志文件路径:

mysql> show variables like 'general_log_file';
+------------------+--------------------------------------+
| Variable_name | Value |
+------------------+--------------------------------------+
| general_log_file | /export/mysql/qingzhu-crs-test-2.log |
+------------------+--------------------------------------+

错误日志文件路径:

mysql>show variables like 'log_error';
+---------------+---------------------+
| Variable_name | Value |
+---------------+---------------------+
| log_error | /var/log/mysqld.log |
+---------------+---------------------+

慢查询日志文件路径:

mysql>show variables like 'slow_query_log_file';
+---------------------+-------------------------------------------+
| Variable_name | Value |
+---------------------+-------------------------------------------+
| slow_query_log_file | /export/mysql/qingzhu-crs-test-2-slow.log |
+---------------------+-------------------------------------------+

posted @ 2022-12-26 20:01  技术改变命运Andy  阅读(268)  评论(0编辑  收藏  举报