MySQL Warning: Using a password on the command line interface can be insecure.解決辦法


 

轉自
http://www.cnblogs.com/sunss/p/6256706.html 

被一個小朋友問到,直接公布答案:

If your MySQL client/server version is a 5.6.x a way to avoid the WARNING message are using the mysql_config_editor tools:

mysql_config_editor set --login-path=local --host=localhost --user=username --password

Then you can use in your shell script:

mysql --login-path=local -e "statement"

instead of:

mysql -u username -p pass -e "statement"

 

使用總結:

mysql_config_editor print --all

mysql_config_editor set --login-path=vip -h10.70.72.22 -uroot -p
mysql_config_editor set --login-path=vip -h10.70.72.12 -uroot -p
mysql_config_editor del --login-path=vip
mysql_config_editor remove vip
mysql_config_editor remove
mysql_config_editor reset
mysql_config_editor set --login-path=local -p
mysql_config_editor set --login-path=vip -h10.70.72.12 -upisp -p
mysql_config_editor set --login-path=vip -h10.70.72.12 -upisp -p


免責聲明!

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



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