Mysql_config_editor appears after the mysql5.6.6 version, you can generate an encrypted file for the specified connection and password. MYLOGIN.CNF, the default is in the current user home directory. This file allows you to log in directly using MySQL, Mysqladmin, and so on, to prevent plaintext passwords from appearing in scripts.
Notice: using this feature requires that the MySQL version of the current host is at 5.6.6 and above, there is no requirement for the MySQL server version that will be logged in. Usage:To
generate an encrypted file :
[[email protected] ~]# mysql_config_editor set--LOGIN-PATH=JJSCJ--host=192.168.1.190--user= JJSCJ--password
Enter Password:
[email protected] ~]# ll ~/.mylogin.cnf
-RW-------1 root root 248 14:58/root/.mylogin.cnf To
log in using an encrypted file:
[[email protected] ~]# mysql--login-path=jjscj
Welcome to the
MySQL Monitor.
to view the encrypted files on the current host:
[Email protected] ~]# mysql_config_editor print--all
[Local]
user = root
Password = * * * *
host = localhost
[JJSCJ]
user = JJSCJ
Password = * * * *
Host = 192.168.1.190
[Remote]
user = JJSCJ
Password = * * * *
host = 192.168.1.190To
Delete an encrypted login:
[email protected] ~]# mysql_config_editor Remove--login-path=remote
[email protected] ~]# mysql_config_editor print--all
[Local]
user = root
Password = * * * *
host = localhost
[JJSCJ]
user = JJSCJ
Password = * * * *
Host = 192.168.1.190 Reset
all :
[[email protected] ~]# mysql_config_editor Reset
Mysql-mysql_config_editor Secure Login Tool