包含标签:运行 的文章
  • show variables like xxx 详解mysql运行时参数

    通过show variables like xxx 详解mysql运行时参数 本文参考以下网页: 1.http://dev.mysql.com/doc/refman/5.1/en/server-status-variables.htm 2.http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html 3.http://www.ibm.com/developerworks/cn/linux/l-tune-lamp-3.html 4.http://www.day32.com/MySQL/tuning-primer.sh 具体数值主要参考此工具 1, 查看MySQL服务器配置信息  mysql> show variables; 2, 查看MySQL服务器运行的各种状态值    mysql> show global status; 3, 慢查询 mysql> show variables like '%slow%'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | log_slow_queries | OFF | | slow_launch_time | 2 | +------------------+-------+ mysql> show global status like '%slow%'; +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | Slow_launch_threads | 0 | | Slow_queries | 279 | +---------------------+-------+ 配置中关闭了记录慢查询(最好是打开,方便优化),超过2秒即为慢查询,一共有279条慢查询  4, 连接数  mysql> show variables like 'max_connections'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 500 | +-----------------+-------+ mysql> show global status like 'max_used_connections'; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | Max_used_connections | 498 | +------------……

    SE_You 2024-04-03
    10 0 0