mysql config

1.show the state of slow query

show variables like '%slow%';
mysqladmin -u root -p variables | grep slow; //another way

2.enable slow query log and slow query time or log path

set global slow_query_log = 'ON';
set global long_query_time = '20';
set global slow_query_log_file ='/var/log/mysql/slow-query.log';

3.关闭日志同步

sync_binlog 0

4.索引之类的缓存大小

innodb_buffer_pool_size

你可能感兴趣的:(mysql config)