## 输入密码 不会在终端系那是
[mysql@test_test_master ~]$ mysql_config_editor set --login-path=test --user=root --password -S /h*****mysql.sock
Enter password:
[mysql@centos ~]$ ll .mylogin.cnf
-rw-------. 1 mysql dba 152 Mar 3 08:09 .mylogin.cnf
##制定路径进行登录
[mysql@test_test_master ~]$ mysql --login-path=xhh
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 590079
Server version: 5.7.15-9-log Source distribution
Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> Bye
## 打印所有的登录路径信息
mysql_config_editor print --all
[login]
user = root
password = *****
host = localhost
socket = /home/mysql/my3306/run/mysql.sock
## 删除其中一个设置
mysql_config_editor remove --login-path=test
## 清除所有的密码设置
mysql_config_editor reset
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29291882/viewspace-2134674/
,如需转载,请注明出处,否则将追究法律责任。