无效查询的MySQL日志 [英] MySQL Log of invalid Queries

查看:82
本文介绍了无效查询的MySQL日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是从PHP运行命令!

I AM NOT RUNNING THE COMMANDS FROM PHP!

我将MySQL log_error值设置为/var/log/mysql/error.log

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

但是,当我连接到数据库并运行SQL命令时,该错误不会出现在日志中.

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!";

有些命令是从某种Windows应用程序运行的.我只想知道是什么无效命令发送给MySQL服务器,以便我尝试解决它们.

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.

推荐答案

错误日志无法执行此操作: https://dev.mysql.com/doc/refman/8.0/en/error-log.html

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

错误日志包含信息 指示何时启动mysqld和 停止,以及任何严重错误 在服务器处于 运行中.

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不会在任何地方记录无效/失败的查询.

MySQL doesn't log invalid/failed queries anywhere.

如果是出于调试目的,则可以尝试设置MySQL代理,该代理可能会记录以下信息:

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/

这篇关于无效查询的MySQL日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆