标签:
mysql> show global variables like "log_error"; +---------------+--------------------------+ | Variable_name | Value | +---------------+--------------------------+ | log_error | /var/log/mysql/error.log | +---------------+--------------------------+ 1 row in set (0.00 sec) ##tail -f error.log 实时监控这个文件中的;
mysql> show global variables like ‘%slow%‘; +---------------------+----------------------------------+ | Variable_name | Value | +---------------------+----------------------------------+ | log_slow_queries | OFF | | slow_launch_time | 2 | | slow_query_log | OFF | | slow_query_log_file | /var/lib/mysql/itcast01-slow.log | +---------------------+----------------------------------+ 4 rows in set (0.00 sec)
mysql> set global slow_query_log =1; Query OK, 0 rows affected (0.00 sec) mysql> show global variables like ‘%slow%‘; +---------------------+----------------------------------+ | Variable_name | Value | +---------------------+----------------------------------+ | log_slow_queries | ON | | slow_launch_time | 2 | | slow_query_log | ON | | slow_query_log_file | /var/lib/mysql/itcast01-slow.log | +---------------------+----------------------------------+ 4 rows in set (0.00 sec)
mysql> show global variables like ‘long_query_time‘; +-----------------+-----------+ | Variable_name | Value | +-----------------+-----------+ | long_query_time | 10.000000 | +-----------------+-----------+
mysql> set global long_query_time = 1; Query OK, 0 rows affected (0.00 sec) mysql> show global variables like ‘long_query_time‘; +-----------------+----------+ | Variable_name | Value | +-----------------+----------+ | long_query_time | 1.000000 | +-----------------+----------+ 1 row in set (0.00 sec)
mysql> show global variables like ‘%general%‘; +------------------+-----------------------------+ | Variable_name | Value | +------------------+-----------------------------+ | general_log | OFF | | general_log_file | /var/lib/mysql/itcast01.log | +------------------+-----------------------------+ 2 rows in set (0.00 sec)
mysql> show global variables like ‘%log_output%‘; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | log_output | FILE | +---------------+-------+ 1 row in set (0.00 sec)
mysql> show global variables like ‘log_bin‘; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | log_bin | OFF | +---------------+-------+ 1 row in set (0.00 sec)
show binary logs; show binlog events in ‘mysql-bin.000001‘
标签:
原文地址:http://www.cnblogs.com/Aiapple/p/5697981.html