日期:2014-05-16 浏览次数:20794 次
1: 对于mysql来说,登录的时候,加一个参数
#mysql -u root -p --prompt="\\u@\\d \\r:\\m:\\s>"
--prompt 是加一些登录后的参数,上面参数 u 是加入登录的用户名, d 是登录后选择后(use dbname)的数据库表, r m s 是时间
2: key_buffer_size 对MyISAM表性能影响很大.
mysql> show variables like 'key_buffer_size'; +-----------------+------------+ | Variable_name | Value | +-----------------+------------+ | key_buffer_size | 536870912 | +-----------------+------------+
mysql> show global status like 'key_read%'; +------------------------+-------------+ | Variable_name | Value | +------------------------+-------------+ | Key_read_requests | 27813678764 | | Key_reads | 6798830 | +------------------------+-------------+
mysql> show global status like 'key_blocks_u%'; +------------------------+-------------+ | Variable_name | Value | +------------------------+-------------+ | Key_blocks_unused | 0 | | Key_blocks_used | 413543 | +------------------------+-------------+
Key_blocks_used / (Key_blocks_unused + Key_blocks_used) * 100% ≈ 80%