如何消除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 |
+-----------+

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM