0

I'm using wordpress and I want to see all SQL being executed at the back-end. Do you guys any good tool which can be used to view any SQL executed by MySQL??

Noor
  • 18,907
  • 36
  • 130
  • 243

1 Answers1

2

Just turn on query logging. Here is a blog article that describes how to do it in detail: MySQL Query Logging.

To enable General query log add log line under the mysqld section in /etc/my.cnf configuration file and restart MySQL server.

log=/var/log/mysqld.log

Many Linux distributions (like Fedora) come with created /var/log/mysqld.log file. Just be sure that mysqld.log file exists and mysql user has permissions to write. If you need to create a log file, use these commands:

# create mysqld.log file 
bash> touch /var/log/mysqld.log
# set owner and group owner for the mysqld.log file 
bash> chown mysql:mysql /var/log/mysqld.log

To see the logs use this command

bash> tail -f /var/log/mysqld.log
JohnFx
  • 34,209
  • 18
  • 103
  • 160