mysql config editor_试用mysql_config_editor

前几天在试用mysql5.6.9主从功能的时候,发现在bin目录中多了一个mysql_config_editor,

试用了一下,感觉很不错,以后不用再重复输入mysql用户名密码了。

[modify@H209 bin]$ pwd

/home/mysql569/bin

[modify@H209 bin]$ ./mysql_config_editor set --login-path=local569 --host=127.0.0.1 --user=root --password

Enter password:

[modify@H209 bin]$

[modify@H209 bin]$ ./mysql_config_editor print --all

[local569]

user = root

password = *****

host = 127.0.0.1

[modify@H209 bin]$ ./mysql --help | grep path

--ssl-capath=name CA directory (check OpenSSL docs, implies --ssl).

--ssl-crlpath=name Certificate revocation list path (implies --ssl).

--login-path=# Read this path from the login file.

ssl-capath (No default value)

ssl-crlpath (No default value)

[modify@H209 bin]$

[modify@H209 bin]$ ./mysql --login-path=local569

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 6

Server version: 5.6.9-rc-log Source distribution

Copyright (c) 2000, 2012, 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>

mysql> select user();

+----------------+

| user() |

+----------------+

| root@localhost |

+----------------+

1 row in set (0.00 sec)

mysql>

[modify@H209 bin]$ ll /home/modify/.mylogin.cnf

-rw------- 1 modify modify 136 01-08 14:07 /home/modify/.mylogin.cnf

.mylogin.cnf文件是加密过的,而且权限设置的很不错。

你可能感兴趣的:(mysql,config,editor)