Hi,
Can anyone please tell me how to log all activity of my mysql database.
Also do you know if there any tripwire services/products that are available ?
Thanks,
Hi,
Can anyone please tell me how to log all activity of my mysql database.
Also do you know if there any tripwire services/products that are available ?
Thanks,
Brief summary and immediate fix based on the config snippet and process output posted by : the server is only writing the error log because the general-query/slow‑query options are not in the server section. was correct that you want the general query log to capture all statements, but those directives must be applied to the server (mysqld) and not the client or the safety wrapper. Enable logging temporarily from SQL to verify behavior, then add persistent directives under the server section and restart.
Quick steps to reproduce and verify (run as a DBA user):
SHOW VARIABLES LIKE 'general_log%';
SET GLOBAL general_log_file = '/var/log/mysql/general.log';
SET GLOBAL general_log = 'ON';
-- when finished:
SET GLOBAL general_log = 'OFF'; Troubleshooting checklist if nothing appears after enabling:
Notes on production and alternatives:
Jump to Post— smantscheff 265Set up a general query log. Cf. http://dev.mysql.com/doc/refman/5.0/en/server-logs.html
Locate your configuration file. It's usually called my.cnf and in /etc/mysql.
Locate a log-bin entry in my.cnf or add it, if it's not there. …
Set up a general query log. Cf. http://dev.mysql.com/doc/refman/5.0/en/server-logs.html
Locate your configuration file. It's usually called my.cnf and in /etc/mysql.
Locate a log-bin entry in my.cnf or add it, if it's not there. log-bin = <location of logfile> Restart the mysql server process.
Thanks. I add this and some different combinations but I am still only logging errors :
[root@william etc]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysql]
log=/var/log/mysql.log
[mysqld_safe]
long_query_time = 1
log-queries-not-using-indexes root 2424 0.0 0.2 63904 1188 pts/2 S 14:44 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --user=mysql Can anyone assist ?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.