mysql 调优

Posted 霂雨

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 调优相关的知识,希望对你有一定的参考价值。

1. show global status  查看所有状态 (可省略)

2. SHOW VARIABLES LIKE ‘max_connections‘ (查找最大连接数),然后修改 my.cnf 文件中 max_connections 的值 为1500

3.重启mysql        sudo service mysql restart

4.查看是否有死锁  show processlist 

5.开启慢查询

 1)在my.cnf 文件下,搜索 mysqld,然后咋其下行 添加

 long_query_time=2

log-slow-queries

log-queries-not-using-indexes 

 

 

 

以上是关于mysql 调优的主要内容,如果未能解决你的问题,请参考以下文章