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??
Asked
Active
Viewed 396 times
0
-
1i think all queries get logged. – hjpotter92 Apr 22 '12 at 06:42
-
Have a look at http://dev.mysql.com/doc/refman/5.1/en/query-log.html – Chetter Hummin Apr 22 '12 at 06:45
-
http://stackoverflow.com/questions/650238/how-to-show-the-last-queries-executed-on-mysql – Kemal Fadillah Apr 22 '12 at 06:54
1 Answers
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,542
- 18
- 104
- 162