0

I'm aware of mysql_query("show processlist"); however what I need is a live feed of the queries being performed as I test my websites on localhost (IIS7+PHP5) on WINDOWS 7.

Why? Because I have to perform optimization on my poorly structured database and I want to identify all the queries and go through all of them, however my php scripts dynamically generates queries and it takes a long time to go through my hundreds of PHP files to add "error_log()" to all of the queries.

I basically want to view the queries live as they are running, or perhaps save them to a text file so I can view them. Perhaps there's a way to have an automatically refreshing list of "show processlist" inside command prompt?

Joe
  • 415
  • 4
  • 17
  • If you don't absolutely need a "live view" of performed queries, then use MySQLs "general query log" by starting `mysqld` with a `--log=fn` http://dev.mysql.com/doc/refman/5.1/en/query-log.html – mario Feb 15 '11 at 00:44
  • Might sound dumb, but I have no idea how to use that. I opened command prompt and typed mysqld --general-log="c:\users\me\desktop\test.txt" - I then went to my localhost site and tested and it didn't add any queries to test.txt -- what am I doing wrong? – Joe Feb 15 '11 at 00:49

1 Answers1

0

Duplicate of: How can I view live MySQL queries?

Check out the General Query Log

Community
  • 1
  • 1
Matt Wonlaw
  • 12,146
  • 5
  • 42
  • 44
  • On windows 7? I'm running on my localhost test machine. – Joe Feb 15 '11 at 00:56
  • I don't see why not. How are you starting mysql? As a windows service or manually from the command prompt? – Matt Wonlaw Feb 15 '11 at 01:32
  • @Joe You'll need to add those parameters to the service startup. I'm not entirely sure where to do this, but somewhere under Control Panel and administration / services. – Matt Wonlaw Feb 21 '11 at 15:19