首页 > 数据库技术 > 详细

DBA-mysql-init-password-5.7

时间:2017-01-05 13:03:23      阅读:196      评论:0      收藏:0      [点我收藏+]

 1.Mysql5.7 Password;

查找临时密码:grep "A temporary password"  /var/log/mysqld.log

修改临时密码:alter user root@‘localhost‘ identified by ‘!QAZ2wsx‘;# ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

查看密码策略:SHOW VARIABLES LIKE ‘validate_password%‘; 

技术分享

 

查看密码插件: show plugins;配置文件[mysqld]标签中添加 validate_passwor=off

技术分享

注意:5.7后,MySQL的 mysql.user 表中的密码字段由之前的 password 改为 authentication_string

经验:所以在数据从5.x迁移到5.7后,需要做更新mysql操作: mysql_upgrade -uroot -p

无临时密码方法:

无密码启动:mysqld_safe --skip-grant-tables &

查看密码:select user,host,authentication_string,password_expired from user;

重设密码 update user set authentication_string=password(‘123abc‘) where user=‘root‘;  flush privileges; 

 

修改MySQL密码方式:

法1:update user set authentication_string=password(‘123abc‘) where user=‘root‘;

法2:set password=password(‘newpassword‘);

法3:alter user root@‘localhost‘ identified by ‘oracle‘;

法4:在shell下使用MySQL工具:mysqladmin -uroot -poldpassword pasword "newpassword"

DBA-mysql-init-password-5.7

原文:http://www.cnblogs.com/baxk/p/6251768.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!