加入账号:
[root@server-mysql bin]# ./mysql_config_editor set --login-path=client --user=root --password --socket=/tmp/mysql.sock5
Enter password:
[root@server-mysql bin]# ./mysql_config_editor set --login-path=client1 --user=root --host=127.0.0.1 --password --port=3310
Enter password:
打印所有已经写入的账号
[root@server-mysql bin]# ./mysql_config_editor print --all
[client]
user = root
password = *****
socket = /tmp/mysql.sock5
[client1]
user = root
password = *****
host = 127.0.0.1
port = 3310
登陆:
[root@server-mysql bin]# ./mysql --login-path=client
账号写入位置:该文件已经加密, 不能被偷看
[root@server-mysql ~]# find / |grep .mylogin.cnf
/root/.mylogin.cnf