explorer
explorer

Reputation: 449

how to change mysql general log path

I change mysql general log from "/var/lib/mysql/general.log" to "/test/general.log",but failed.

root@iZbp1606ryhhy2d1cq7h12Z:/test# ll /
drwxr-xr-x   3 root    root     4096 Mar  9 15:23 test/

root@iZbp1606ryhhy2d1cq7h12Z:/test# ll /test/
drwxr-xr-x  2 mysql mysql 4096 Mar  9 15:23 mysql/

After mkdir "/test/mysql" and set permission. then log into mysql, with below command.

mysql -uroot -p
mysql> set GLOBAL general_log_file = '/test/mysql/gen.log';
Query OK, 0 rows affected (0.00 sec)
mysql> set GLOBAL general_log =1;
ERROR 29 (HY000): File '/test/mysql/gen.log' not found (Errcode: 13 - Permission denied)

how can I change mysql defalt path to "/test/mysql/gen.log"

Upvotes: 1

Views: 4407

Answers (1)

Ashish Tiwari
Ashish Tiwari

Reputation: 2277

Goto /etc/mysql/my.cnf. You will get log_error and general_log flag where you can set new log path accordingly.

Upvotes: 1

Related Questions