ConnorShip

1.停止mysql服务器

sudo service mysql stop

2.启动mysql服务

sudo mysqld_safe --skip-grant-tables

3.登陆 mysql

mysql

4.重新载入权限

flush privileges;

5.进入数据库

use mysql

6.查询user用户

select user,host,password from user

7.向root用户授予权限

GRANT USAGE ON *.* TO \'root\'@\'localhost\' IDENTIFIED BY \'Password\' WITH GRANT OPTION;

grant all on *.* to \'root\'@\'localhost\' identified by \'password\';

8.刷新,退出

flush privileges;

exit;

此时便可以访问数据库了!!!

分类:

技术点:

相关文章:

  • 2021-07-24
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-05-21
猜你喜欢
  • 2022-01-15
  • 2022-12-23
  • 2021-12-26
  • 2021-12-19
  • 2022-12-23
  • 2021-09-14
  • 2021-12-26
相关资源
相似解决方案