原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处 、作者信息和本声明。否则将追究法律责任。
http://yueliangdao0608.blog.51cto.com/397025/1175270
随着MySQL 5.6 的GA, MySQL在一些细节上越来越美。 今天来体验下两个安全验证方面的细节提升。
1. mysql_config_edit 工具。 可以用来加密用户的密码,增强数据库安全。
使用方法:
- 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>
现在来设置新的密码:
- mysql> set password for ytt_new@'localhost'= password('2lOp23dll&D');
- Query OK, 0 rows affected (0.00 sec)
- mysql> flush privileges;
- Query OK, 0 rows affected (0.00 sec)
- mysql>
本文出自 “上帝,咱们不见不散!” 博客,请务必保留此出处http://yueliangdao0608.blog.51cto.com/397025/1175270