iread9527
sudo vim /etc/mysql/my.cnf

添加如下内容:

[mysqld]
skip-grant-tables=1

重启mysql服务

sudo service mysql restart

登录mysql

mysql

切换到mysql数据库,并修改root用户密码

use mysql;
update user set plugin=\'mysql_native_password\' where user=\'root\';
update user set authentication_string=password(\'123456\') where user=\'root\';
flush privileges;
exit;

修改配置并重启mysql服务

sudo sudo vim /etc/mysql/my.cnf把skip-grant-tables删除掉
sudo service mysql restart

分类:

技术点:

相关文章:

  • 2021-05-06
  • 2021-12-08
  • 2021-12-12
  • 2021-10-20
  • 2022-02-10
  • 2021-08-08
  • 2021-08-16
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-11-06
  • 2021-10-11
  • 2021-04-11
  • 2022-01-02
相关资源
相似解决方案