内容简介:这篇文章主要介绍了 Mysql用户忘记密码及密码过期问题的处理方法,分步骤给大家介绍的非常详细,需要的朋友参考下
忘记密码:
步骤一:现在找到MySQL的安装目录,改掉安装目录的 my-default.ini名称为my.ini(D:\Mysql\mysql-5.7.13-winx64);
步骤二:在my.ini文件最后一行加上skip-grant-tables 并保存(这是去掉安全检查);
步骤三:在服务中 重启 MySQL 服务;
步骤四:cmd 命令进入Mysql安装bin目录下输入mysql -uroot -p,按回车;(这里是以账号root为例子)
步骤五:会出现‘Enter password',再按下回车,此时进入mysql>;
步骤六:输入命令 ‘use mysql'回车,再输入修改密码 sql 语句:
update user set password=password("new_pass") where user="root";
然后将my.ini文件中的skip-grant-tables去掉,然后重启mysql,就OK了。
注意:如果是MySQL5.7.13版本,会报ERROR 1054 (42S22): Unknown column ‘password' in ‘field list'这样的error;
这样我们将sql语句改为:
update user set authentication_string=password(‘root') where user='root';
密码过期:
步骤一:通过"Mysql忘记密码方法" 先进入mysql;
步骤二:将mysql数据库下的user表的password_expired值改为N;
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
The Smashing Book
Jacob Gube、Dmitry Fadeev、Chris Spooner、Darius A Monsef IV、Alessandro Cattaneo、Steven Snell、David Leggett、Andrew Maier、Kayla Knight、Yves Peters、René Schmidt、Smashing Magazine editorial team、Vitaly Friedman、Sven Lennartz / 2009 / $ 29.90 / € 23.90
The Smashing Book is a printed book about best practices in modern Web design. The book shares technical tips and best practices on coding, usability and optimization and explores how to create succes......一起来看看 《The Smashing Book》 这本书的介绍吧!