I'm using MySQL / 10.1.29-MariaDB-6 on Kali Linux 2018 VM.
I have the following entry in mariadb.cnf, mysql.cnf, and 50-server.cnf.
general_log_file = /var/log/mysql/mysql.log
general_log = 1
The conf file shows that the following config files are used to determine options:
The MariaDB/MySQL tools read configuration files in the following order:
/etc/mysql/mariadb.cnf
(this file) to set global defaults,/etc/mysql/conf.d/*.cnf
to set global options./etc/mysql/mariadb.conf.d/*.cnf
to set MariaDB-only options.~/.my.cnf
to set user-specific options. Logging IS working to the file specified, but whenever I try to type the following mysql command, I am met with the following error:
root@kali:/var/log/mysql# mysql -u root -p
mysql: unknown variable 'general_log_file=/var/log/mysql/mysql.log'
How to fix this error?
Check the sections of the config file(s) where general_log_file
option is set. It must be [mysqld]
, or [server]
, or [mariadb]
and alike, but it must not be [mysql]
or [client]
or alike. general_log_file
is a server-only option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With