发布网友
共1个回答
热心网友
,在/etc/my.cnf末尾加入skip-grant-tables,保存,跳过身份验证。
2,重启MySql,使刚才修改的配置生效。
3,终端输入mysql,然后再输入usemysql;
4,终端输入
updatemysql.usersetauthentication_string=password('123456')whereuser='root';
5,在/etc/my.cnf末尾去掉skip-grant-tables,保存。
6,重启MySql,终端输入mysql-uroot-p,然后根据提示输入刚设置的密码即可正常使用了。