当前位置:Gxlcms > 数据库问题 > mysql 消除 "[Warning] Using a password on the command line interface can be insecure"

mysql 消除 "[Warning] Using a password on the command line interface can be insecure"

时间:2021-07-01 10:21:17 帮助过:16人阅读

如果将mysql密码明文写出来,进入的时候,系统前台会打印:

[Warning] Using a password on the command line interface can be insecure

意思就是说,密码露了,不安全。

我们执行脚本的时候,最好可以把这个东西干掉,否则一直弹弹弹,烦的要死。

于是我们可以:

?

1. 建立一个文件,存放用户名、密码

touch /etc/my.password

然后写入下列内容:

[client]
user=root
password=密码

?

2. 登录时,不使用-u -p来指定,使用--defaults-extra-file=/etc/my.password来指定配置文件进行登录,就可以消掉那行warning了。

mysql --defaults-extra-file=/etc/my.password

mysql 消除 "[Warning] Using a password on the command line interface can be insecure"

标签:font   file   配置   class   using   一个   最好   前台   com   

人气教程排行