1

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?

Sarmen B.
  • 63
  • 5

2 Answers2

1

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

Community
  • 1
  • 1
The Scrum Meister
  • 29,681
  • 8
  • 66
  • 64
  • i dont seem to have my.ini i use mamp for mac and im trying to figure out where this is or how to do it. any clue? – Sarmen B. Feb 08 '11 at 09:43
0

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.

rik
  • 8,592
  • 1
  • 26
  • 21
  • where is the etc directory ? is it in mamp somewhere i cant find it. – Sarmen B. Feb 08 '11 at 09:52
  • Apparently MAMP doesn't use my.cnf, but you can create one and append your settings: http://forum.mamp.info/viewtopic.php?f=2&t=6306 – AJJ Feb 08 '11 at 10:09