open mysql slow query error:

1. Go to the mysql command line: #mysql -uroot -p123456, execute the following command to enable the slow query error:

set global slow_query_log=on;

set global long_query_time = 1; # set the record over how long sql query

set global slow_query_log_file = '/ opt / data / slow_query.log'; # Set mysql slow query log path


 [y1]报错:ERROR 29 (HY000): File '/opt/data/slow_query.log' not found (Errcode: 13 - Permission denied)

 

 错误内容:ERROR 29 (HY000): File '/opt/data/slow_query.log' not found (Errcode: 13 - Permission denied)

2. Analysis:

①File '/opt/data/slow_query.log' not found did not find this file, but the actual path of the file is there.

②permission denied ------- file permissions in this path is not enough

3 ,. The solution: the original file slow_query.log delete and re-create a new file slow_query.log, then give permission:

#cd /opt/data

#rm -rf slow_query.log

#touch slow_query.log

#chown mysql slow_query.log

 

 Restart mysql: # / opt / lampp / lampp restart

4. Go to mysql: turn on slow query:

 

 So far the problem is solved.

Guess you like

Origin www.cnblogs.com/yyl6/p/12051985.html