Sarmen B.
Sarmen B.

Reputation: 63

how to view all the queries that are being performed on my web app

i have a mac with snow leopard and i have sequel pro and im trying to figure out how i can view all the queries that are being done on my web site so that i can track down the problem. how can i do this? on sequel pro there is a console that i can click on and all it shows me are the selects being done so when i do a delete it doesnt show that. would this information be somewhere?

Upvotes: 1

Views: 536

Answers (2)

rik
rik

Reputation: 8612

Open /etc/my.cnf or create it if it does not already exist. Add or uncomment the line log=/var/log/mysqld.log in the [mysqld] section.

Create the logfile with sudo touch /var/log/mysqld.log and make it writeable for the mysql user with sudo chown _mysqld /var/log/mysqld.log. Note that you'll may have to replace _mysql!

Now restart MySQL and view the log with tail -f /var/log/mysqld.log or in console app.

Upvotes: 0

The Scrum Meister
The Scrum Meister

Reputation: 30111

To view live queries run SHOW FULL PROCESSLIST. Note, that you should run this from a user that has PROCESS permissions.

Alternatively, you can log all queries that mysql processes, by setting log = all.log in the my.ini file.

Also see this question: Log all queries in mysql

Upvotes: 1

Related Questions