mysql5.7怎么重置密码
发布时间:10/01 来源:未知 浏览:
关键词:
mysql5.7重置密码的办法:第一施行【update user set authentication_string = password('123456') where user = 'root';】语句;然后重新启动mysql效劳即可。
详细办法:
(引荐教程:mysql视频教程)
关闭MySQL5.7的权限系统
寻到MySQL5.7的配置文件my.cnf
在文件末尾编纂增添代码skip-grant-tables
重新启动mysqld效劳,登陆MySQL
$systemctl restart mysqld
此时再登录mysql时,不需要密码就登录进去了。
修改root密码
$use mysql; $select host,user,authentication_string from user; #修改root密码 $update user set authentication_string = password('123456') where user = 'root';
开启权限系统,重新启动MySQL,新密码登录
$vim /etc/my.cnf #开启权限系统 #skip-grant-tables #重新启动mysql $systemctl restart mysqld #新root密码登陆 $mysql -uroot -p
相关引荐:mysql教程
以上就是mysql5.7如何重置密码的具体内容,更多请关注百分百源码网其它相关文章!