mysql_config_editor的使用

从Mysql5.6.6 开始mysql_config_editor允许存储加密的身份验证文件.mylogin.cnf

如果不想每次登录服务器都输入数据库的密码可以使用该功能

mysql_config_editor set --login-path=test --host=localhost --user=root --password

回车 输入数据库的root密码 abcd1234

在/root目录下会生成隐藏文件.mylogin.cnf文件

登录数据库可以使用 

mysql --login-path=test 来进行登录

root密码变更以后需要重新执行mysql_config_editor进行登录。

 

参考官方文档

https://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html

posted @ 2017-06-05 14:27  haoshuaili  阅读(234)  评论(0编辑  收藏  举报