破霜风

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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
posted on 2019-01-30 10:04  破霜风  阅读(793)  评论(0编辑  收藏  举报