Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Log of invalid Queries

Tags:

I AM NOT RUNNING THE COMMANDS FROM PHP!

I have MySQL log_error value set to /var/log/mysql/error.log

However when I connect to a database and run an SQL command, the error does not appear in the log.

 SELECT *  FROM some_table where this_is_invalid_and_will_fail="Doesn't matter because column doesn't exist!"; 

There are commands running from some sort of windows application. All I want to know is what invalid commands its sending to the MySQL server so that I can attempt to resolve them.

like image 459
anon5456919 Avatar asked Jan 07 '11 23:01

anon5456919


People also ask

Where is the MySQL error log?

The error log is located in the data directory specified in your my. ini file. The default data directory location is C:\Program Files\MySQL\MySQL Server 8.0\data , or C:\ProgramData\Mysql on Windows 7 and Windows Server 2008.

What are MySQL query logs?

The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients.


1 Answers

Error log doesn't do that: https://dev.mysql.com/doc/refman/8.0/en/error-log.html

The error log contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running.

MySQL doesn't log invalid/failed queries anywhere.


If it's for debugging purposes, you might try setting up a MySQL Proxy, which could log this I think:

http://dev.mysql.com/downloads/mysql-proxy/

like image 194
Mchl Avatar answered Sep 22 '22 20:09

Mchl