Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How To Turn on Query Logs
How To Turn on Query Logs? - MySQL FAQs - Server Daemon mysqld Administration
✍: FYIcenter.com
If you want MySQL to write query logs to a file, you can use the "--log=fileName" option at the "mysqld" command line. The tutorial exercise below shows you a good example on how to use this option and view the query log file:
>cd \mysql\bin >mkdir \mysql\logs >mysqld --log=\mysql\logs\query.log
Starts another command window, and enter the following commands:
>cd \mysql\bin >mysql -u root -pretneciyf mysql> USE test; Database changed mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | articles | | links | | test | +----------------+ 3 rows in set (0.03 sec) mysql> SELECT * FROM links; +------+-------------------+ | id | name | +------+-------------------+ | 1 | dba.fyicenter.com | | 10 | dba.fyicenter.com | +------+-------------------+ 2 rows in set (0.11 sec) mysql> EXIT; Bye
Here is what you will get in the query log file:
>type \mysql\logs\query.log mysqld, Version: 5.0.24-community-log. started with: Tcp port: 0 Unix socket: (null) Time Id Command Argument 20:19:41 3 Connect root@localhost on 20:20:00 3 Query SELECT DATABASE() 3 Init DB test 20:20:05 3 Query show tables 20:20:52 3 Query SELECT * FROM links 20:21:02 3 Quit
2007-05-11, 4773👍, 0💬
Popular Posts:
How Do You Uninstall JUnit Uninstalling JUnit is easy. Just remember these: Delete the directory tha...
What is Traceability Matrix? Traceability Matrix is one of the document will prepare by QA.To make s...
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by p...
. How can a servlet refresh automatically if some new data has entered the database? You can use a c...
How do we assign page specific attributes ? Page attributes are specified using the @Page directive.