rgb192
asked on
only want the sql commands in a log
this question is a followup to question
https://www.experts-exchange.com/questions/28014676/only-want-the-last-query-looking-for-mysql-answer.html
I run one query
I only want row 5 in the log file
how to customize the log to show the query command instead of detailed time and detailed db information
https://www.experts-exchange.com/questions/28014676/only-want-the-last-query-looking-for-mysql-answer.html
# Time: 130201 7:22:28
# User@Host: root[root] @ localhost [127.0.0.1]
# Query_time: 0.283016 Lock_time: 0.258015 Rows_sent: 0 Rows_examined: 0
SET timestamp=1359721348;
insert into sent(posting_id) values('sample2');
I run one query
I only want row 5 in the log file
how to customize the log to show the query command instead of detailed time and detailed db information
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I learned something new today which I think will make your life easier. Configure MySQL to log to a database table instead. Again you can only do this on a machine you have full control of (not on a shared hosting server):
log out and login back again. Do your queries, etc.
You will get an output like:
If you have clarifications on this please post a new question.
set global log_output='TABLE';
set global long_query_time=0;
set global slow_query_log=ON;
log out and login back again. Do your queries, etc.
mysql> select start_time, sql_text from mysql.slow_log where sql_text!='';
You will get an output like:
MariaDB [mysql]> select start_time, sql_text from slow_log where sql_text!='';
+----------------------------+---------------------------------------------------------------------------------------+
| start_time | sql_text |
+----------------------------+---------------------------------------------------------------------------------------+
| 2013-02-08 10:29:25.773653 | select @@version_comment limit 1 |
| 2013-02-08 10:29:34.520785 | select * from a |
+----------------------------+---------------------------------------------------------------------------------------+
If you have clarifications on this please post a new question.
ASKER
almost worked
this is the new question:
https://www.experts-exchange.com/questions/28030458/logging-mysql-to-mysql-table-on-windows.html
this is the new question:
https://www.experts-exchange.com/questions/28030458/logging-mysql-to-mysql-table-on-windows.html
ASKER
now I need to know how to install the software on wamp
https://www.experts-exchange.com/questions/28018440/run-mysql-log-on-wamp.html