我想更改我的 MySQL 密码,但不想将我的新密码写入我的 MySQL 日志文件。是否可以指示 MySQL 不记录下一个输入的命令?
最佳答案
新密码永远不会写入日志中,这将严重破坏安全性。
source :
语句日志记录避免为以下语句以明文形式写入密码:
CREATE USER ... IDENTIFIED BY ...
GRANT ... IDENTIFIED BY ...
SET PASSWORD ...
SLAVE START ... PASSWORD = ...
CREATE SERVER ... OPTIONS(... PASSWORD ...)
ALTER SERVER ... OPTIONS(... PASSWORD ...)
这些语句中的密码被重写为不会按字面意义出现在写入一般查询日志的语句文本中。
但是如果密码是明文写的,这意味着服务器是用--log-raw
选项启动的:
For the general query log, password rewriting can be suppressed by starting the server with the
--log-raw
option. For security reasons, this option is not recommended for production use. For diagnostic purposes, it may be useful to see the exact text of statements as received by the server.
关于mysql - 在不登录的情况下更改 MySQL 密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49196139/