设为首页 加入收藏

TOP

Mysql5.7.8安装文档(二进制安装)(二)
2015-11-21 02:02:12 来源: 作者: 【 】 浏览:1
Tags:Mysql5.7.8 安装 文档 二进制

max_user_connections: 0
plugin: mysql_native_password
authentication_string: *D5F86FA8F536F9E81C12E8A993EF5292A90259FB
password_expired: Y
password_last_changed: 2015-08-18 11:11:39
password_lifetime: NULL
account_locked: N
1 row in set (0.00 sec)

只有一个root帐号,并且密码已经过期了。
在这里修改密码的时候,要考虑到pasword_expied,设置成N,才可以用。

修改密码:
mysql> update mysql.user set authentication_string=password(‘redhat’), password_expired=’N’ where user=’root’;
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
可能感觉这个方法有点怪异,为什么不直接set password=password();
看一下
mysql> set password=password(‘123’);
ERROR 1131 (42000): You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords

答案是不可以,因为mysql.user表已经没有这个字段了。

修改完成之后,用root登录。
mysql> select current_user();
+—————-+
| current_user() |
+—————-+
| root@localhost |
+—————-+
1 row in set (0.00 sec)

登录ok。

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MySQL获取某月所有的日期点 下一篇Linux监控(OS,MySQL,Tomcat,A..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: