My SQL可以用下面方法跟踪sql 语句,以下方法以Windows平台为例,linux雷同:
log="C:/temp/mysql.log"
log_slow_queries="C:/temp/mysql_slow.log"
long_query_time=1
错误信息一:无法启动mysql服务,错误提示 1067:进程意外终止
警告信息一:option 'general_log': boolean value 'D:/data/mysql.log' wasn't recognized. Set to OFF.
警告信息二:option 'slow_query_log': boolean value 'D:/data/mysql_slow.log' wasn't recognized. Set to OFF.
请参考:http://serverfault.com/questions/397324/mysql-5-6-wont-start-on-os-x-ambiguous-option
http://*.com/questions/11606972/how-can-i-enable-slow-query-log-on-my-server
http://*.com/questions/6428532/log-queries-not-using-index-mysql
http://dev.mysql.com/doc/refman/5.6/en/slow-query-log.html
最终改成以下形式即可!
explicit_defaults_for_timestamp
general-log=1
general-log_file="D:/data/mysql.log"
slow_query_log=1
slow_query_log_file="D:/data/mysql_slow.log"
long_query_time=1
log_queries_not_using_indexes =1