来源:https://software.codidact.com/posts/280843
在使用 mysql -pXXXX
的时候,会有一个警告,说是直接输出密码是不安全的
mysql: [Warning] Using a password on the command line interface can be insecure
可以使用下面的方式避免输出这个警告
创建一个文件 /root/my.conf
,里面包括客户端的密码
[client]
password=XXX
然后在执行 mysql
命令的时候加一个参数:
mysql --defaults-extra-file=/root/my.conf