t@ytt-centos6-3 ~]$ mysql_config_editor set --login-path=itsmine --host=localhost --user=ytt --password
Enter password:
[ytt@ytt-centos6-3 ~]$ mysql --login-path=itsmine -S /tmp/mysql3307.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
...
mysql> select user();
+---------------+
| user() |
+---------------+
| ytt@localhost |
+---------------+
1 row in set (0.00 sec)
mysql> exit
Bye
mysql_config_edit 加密后的数据保存在用户主目录下:
[ytt@ytt-centos6-3 ~]$ file .mylogin.cnf
.mylogin.cnf: data
2. 密码强度验证插件
查看是否安装有此插件
mysql> show plugins;
+----------------------------+----------+--------------------+----------------------+-------------+
| Name | Status | Type | Library | License |
+----------------------------+----------+--------------------+----------------------+-------------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
...
| validate_password | ACTIVE | VALIDATE PASSWORD | validate_password.so | PROPRIETARY |
+----------------------------+----------+--------------------+----------------------+-------------+
45 rows in set (0.00 sec)
mysql>