1.show full processlist;
可用于生产环境现场查看哪些锁存在。
2show innodb status;
用于查看死锁。
3.slow log
用户查看慢查询
4.show status
用户调优my.cnf参数,具体详见
修改参数示例:
set global key_buffer_size=1073741824; 'key_buffer_size' set global table_open_cache=2048; show variables like 'table_open_cache'; show variables like 'open-files- limit'; set global query_cache_size=128M; set global table_open_cache=1024; set global max_connections=00; max_connections=800 Opened_tables key_buffer_size show status like 'key_read%'; SHOW STATUS LIKE 'Qcache%' show variables like 'innodb_buffer_pool_size'; innodb_buffer_pool_size show variables like 'read_buffer_size';
根据status信息对MySQL服务器进行优化(一)
根据status信息对MySQL服务器进行优化(二)
5.案例
Chambon <bernard.chambon@ stripped> wrote:
> Can somebody tell me if 'key_buffer' and 'key_buffer_size' are the same variables ?
Yes. _size is deprecated.
> Perhaps it is just a question of syntax, I mean, in the my.cnf
> you write key_buffer=100M
> or you write set-variable = key_buffer_size=100M
It's the same. "set-variable" is deprecated, so use the first syntax instead.
> Same question for
> sort_buffer and sort_buffer_size,
> thread_cache and thread_cache_size,
> innodb_buffer_pool and innodb_buffer_pool_size
> etc.
All the same :-)
'key_buffer' 和'key_buffer_size' 是一样的意思