码迷,mamicode.com
首页 > 数据库 > 详细

MySQL5.7没有初始密码解决办法

时间:2020-04-29 15:12:11      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:roo   tables   mys   flush   localhost   etc   use   nta   containe   

1.开启跳过权限验证

vi /etc/my.cnf
[mysqld]
skip-grant-tables

/etc/init.d/mysqld restart

2.重置密码

use mysql;
update user set authentication_string=password(‘123456‘) where user=‘root‘ and host=‘localhost‘;
flush privileges;

/etc/init.d/mysqld restart

vi /etc/my.cnf
[mysqld]
skip-grant-tables    #delete

/etc/init.d/mysqld restart

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘123456‘;

MySQL5.7没有初始密码解决办法

标签:roo   tables   mys   flush   localhost   etc   use   nta   containe   

原文地址:https://www.cnblogs.com/yanyanqaq/p/12801710.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!