I’m seriously having problems logging queries with mysql. I’ve opened my.cnf and modified a few lines, according to some online sources. But the outcome was nil.
I’ve also read up on the docs at dev.mysql.com: http://dev.mysql.com/doc/refman/5.1/en/query-log.html
I’m obviously misunderstanding what they’re trying to convey.
Here’s what I’m typing into the command line:
service mysqld start -l mysqllogs.log
That didn’t work.
I’ve opened /etc/my.cnf and added:
[mysqld_safe]
log-error=/var/log/mysqld/errors.log
log=/var/log/mysqld/mysql.log
pid-file=/var/run/mysqld/mysqld.pid
I even tried:
log-query=/var/log/mysqld/queries.log
So far I don’t see any queries being logged. But I do see the errors.log getting generated just fine. I’m confused.
I don’t want to edit the /etc/init.d/mysqld , kinda worried I’ll mess something up.
Has anyone had this issue? How do I turn on query logging? (not talking about slow queries)
mysqld_safe is just shell script that invokes mysql server. So you need to add lines to [mysqld] section. Not in [mysqld_safe]
kind of
and restart mysql server after that.