1. 程式人生 > >Warning: Using a password on the command line interface can be insecure.解決辦法

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

com localhost log dev title war cli too edit

轉自 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"

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