打开慢查询日志
long_query_time=0
slow_query_log=ON
查看日志位置slow_query_log_file 参数指定的位置。
mysql> show variables where variable_name like '%query%';
+------------------------------+----------------------------------+
| Variable_name | Value |
+------------------------------+----------------------------------+
| binlog_rows_query_log_events | OFF |
| ft_query_expansion_limit | 20 |
| have_query_cache | YES |
| long_query_time | 0.000000 |
| query_alloc_block_size | 8192 |
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 1048576 |
| query_cache_type | OFF |
| query_cache_wlock_invalidate | OFF |
| query_prealloc_size | 8192 |
| slow_query_log | ON |
| slow_query_log_file | /app/mysql/data/DEVAPP0-slow.log |
+------------------------------+----------------------------------+
日志说明
# Time: 131227 11:27:21 操作时间
# User@Host: root[root] @ localhost [] Id: 2 登陆用户以及进程id show processlist显示的会话id
# Query_time: 0.001143 Lock_time: 0.000214 Rows_sent: 1 Rows_examined: 1 基本统计信息, 查询时间、锁时间、查询记录数、扫描记录
use ezsela;
SET timestamp=1388114841;
select usrid from loan_app_save where usrid like 'fdl123%';
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15711267/viewspace-1064922/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/15711267/viewspace-1064922/