1、my.ini文件中的[mysqld]下面一行添加 skip_grant_tables
2、update user set host = 'localhost' where user = 'root'
3、UPDATE user SET Password=PASSWORD('xiaoli') where USER='root'
4、将my.ini中添加的 skip_grant_tables 删除
2、update user set host = 'localhost' where user = 'root'
3、UPDATE user SET Password=PASSWORD('xiaoli') where USER='root'
4、将my.ini中添加的 skip_grant_tables 删除
本文提供了一套步骤指南,用于在MySQL环境中更新root用户的权限设置,并加强安全性。首先,通过在my.ini配置文件中添加skip_grant_tables选项跳过授权表的读取,然后使用SQL命令更新root用户主机名和密码,确保系统安全。最后,移除my.ini中临时的skip_grant_tables设置,恢复常规操作。

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



