一、修改配置文件
vim /etc/my.cnf
添加 skip-grant-tables
重启mysql
service mysqld restart
二、操作
2.1修改密码
进入mysql 数据库,使用user表
update user set password=password('new_password') where host='root'
2.2 远程链接权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
flush privileges;
3、删除重启mysql
删除1中添加的语句并重启
service mysqld restart
本文介绍了如何通过编辑my.cnf配置文件在MySQL中添加skip-grant-tables,修改root用户密码,并授予远程访问权限。随后步骤包括删除临时更改并重启服务。

1327

被折叠的 条评论
为什么被折叠?



