当前位置:Gxlcms > 数据库问题 > MySQL5.7没有初始密码解决办法

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

时间:2021-07-01 10:21:17 帮助过:3人阅读

目录

  • 1.开启跳过权限验证
  • 2.重置密码

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   

人气教程排行