Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> Services >> RDBMS >> MySQL >> How to enable TRACING of SQL query to a log file

Method 1

1.  login as root

mysql -uroot -p

2.  use mysql database;

mysql> use mysql

3.  check current setting of the varilable general_log

mysql> show variables like 'general_log%';

note value of

      general_log :
      general_log_file :

if general_log is OFF, set it to ON by

4.  set logging to ON and specify the path

mysql> SET GLOBAL general_log='ON';

mysql> SET GLOBAL general_log_file='somepath';

 Method 2

edit /etc/my.cnf

add following line to the mysqld section

log=path-to-query-log

then restart mysql

# /etc/init.d/mysql stop
# /etc/init.d/mysql start

 

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]