MySQL 5.6 Warning: Using a password on the command line interface can be insecure


MySQL 5.6 在命令行輸入密碼,就會提示這些安全警告信息。

Warning: Using a password on the command line interface can be insecure.

注: mysql -u root -pPASSWORD 或 mysqldump -u root -pPASSWORD 都會輸出這樣的警告信息。

 

1、針對 mysql

mysql -u root -pPASSWORD 改成 mysql -u root -p 再輸入密碼即可。

 

2、mysqldump 就比較麻煩了,通常都寫在scripts腳本中。

vim /etc/mysql/my.cnf

[mysqldump]
user=your_backup_user_name
password=your_backup_password

修改完配置文件,重啟MyQL后,只需要執行 mysqldump 腳本就可以了。備份腳本中不需要涉及用戶名密碼相關信息。


免責聲明!

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



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