如何消除mysql: [Warning] Using a password on the command line interface can be insecure.

在写脚本时经常需要在命令行使用明文密码,虽然不安全,但是很方便,出现[Warning] Using a password 就很讨厌,下面给出个解决方式

 

方法: 使用 2>/dev/null

#mysql --user=root --password=123456  -e "select version()" 2>/dev/null

+-----------+
| version() |
+-----------+
| 8.0.23-14 |
+-----------+

原文地址:https://www.cnblogs.com/9527l/p/14958097.html