码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2020-01-04 20:13:30      阅读:65      评论:0      收藏:0      [点我收藏+]

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

如果将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   

原文地址:https://www.cnblogs.com/young233/p/12149996.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!