Give permission to a file when making a queries log (queries) in mysql

1

I try to make a mysql querys log in ubuntu and do the following (recommended for mysql 5.6+, which is the version I have):

[mysqld]
general_log = on
general_log_file=/var/log/apache2/mysql-query.log

in my my.cnf file.

When I restart the mysql service I do tests and the queries are not stored in the path that I specified. The file has 666 permissions and the owner left it in the following way:

sudo chown mysql:mysql /var/log/apache2/mysql-query.log

Then I enter mysql from the console and manually execute what I put in my my.cnf file.

 SET GLOBAL general_log = 'ON';

and I get the following error:

  

ERROR 29 (HY000): File '/var/log/apache2/mysql-query.log' not found (Errcode: 13 - Permission denied)

Why? It is assumed that the file already has permissions. I need help.

    
asked by Rene Limon 03.07.2018 в 19:09
source

1 answer

0

I solved the problem based on this answer found on ServetFault.

It seems that the problem was the permissions of the log file. Despite having the correct permissions, the user does not have access to the route indicated (I do not know why he can not access). What I did was create the log in the data folder of mysql / var / lib / mysql / .

Now it works correctly on the new specified route.

    
answered by 17.08.2018 / 20:19
source