victorfrost

1、修改my.cnf配置文件

vi /etc/my.cnf

#允许免密认证登陆
skip-grant-tables = true

2、重启Mysql数据库并登陆数据库修改root用户密码

systemctl restart mysqld
mysql -uroot
mysql> update mysql.user set authentication_string = \'password\' where user=\'root\';

3、恢复my.cnf配置文件并重启数据库

vi /etc/my.cnf

#允许免密认证登陆
#skip-grant-tables = true

systemctl restart mysqld

分类:

技术点:

相关文章: