Mysql—常见查询命令

查询mysql的日志

-- 查找错误日志文件路径
mysql> show variables like "log_error";
-- 查找通用日志文件路径
mysql> show variables like "general_log_file";
-- 查找慢查询日志文件路径
mysql> show variables like "slow_query_log_file";

查找mysql的连接数:show status 查看所有状态参数,其中Threads_connected 当前的连接数。

mysql> show global status like "%connect%";

查看mysql的运行时长

mysql> show global status like "uptime";

查看mysql的版本信息

mysql> select version();
mysql> show variables like '%version%';

  

  

原文地址:https://www.cnblogs.com/liuhaidon/p/11671920.html