我没有从 PHP 运行命令!
我将 MySQL log_error 值设置为/var/log/mysql/error.log
但是,当我连接到数据库并运行 SQL 命令时,错误不会出现在日志中。
SELECT *
FROM some_table
where this_is_invalid_and_will_fail="Doesn't matter because column doesn't exist!";
有些命令从某种 Windows 应用程序运行。我只想知道它向 MySQL 服务器发送了哪些无效命令,以便我可以尝试解决它们。
最佳答案
错误日志不会这样做: 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 不会在任何地方记录无效/失败的查询。
如果它是为了调试目的,你可以尝试设置一个 MySQL 代理,我认为它可以记录这个:
关于sql - 无效查询的 MySQL 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4631133/