mysql5.7提示密码过期_Mysql 5.7.17 初始化完成登录mysql提示密码过期

说明:https://www.cndba.cn/leo1990/article/2231

安装Mysql 5.7.17 登录root 用户使用初始化密码提示如下错误:

https://www.cndba.cn/leo1990/article/2231

[root@dg1 bin]# ./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

2017-09-15T17:02:21.325100Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2017-09-15T17:02:21.340179Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.

2017-09-15T17:02:21.340188Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.

2017-09-15T17:02:21.607826Z 0 [Warning] InnoDB: New log files created, LSN=45790

2017-09-15T17:02:21.694184Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2017-09-15T17:02:21.767894Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: a3a83820-9a37-11e7-974b-08002756e36d.

2017-09-15T17:02:21.771093Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2017-09-15T17:02:21.771983Z 1 [Note] A temporary password is generated for root@localhost: xqIejk1p1H:l

[root@dg1 bin]# mysql -u root -p

Enter password:

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.

https://www.cndba.cn/leo1990/article/2231https://www.cndba.cn/leo1990/article/2231

解决方法:

https://www.cndba.cn/leo1990/article/2231

https://www.cndba.cn/leo1990/article/2231

[root@dg1 bin]# /usr/local/mysql/bin/mysql -u root -p

Enter password:

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

Your MySQL connection id is 5

Server version: 5.7.17

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

https://www.cndba.cn/leo1990/article/2231https://www.cndba.cn/leo1990/article/2231

原因分析:

安装Linux 操作系统的时候,默认安装了mysql,并且版本与自己安装的mysql版本不一致,直接使用mysql -uroot -p‘password‘连接,默认调用的是系统安装的mysql版本,所以会提示密码过期。可以通过指定mysql的绝对路径或者拷贝新安装的mysql客户端到系统路径下解决此问题。

版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值