- 做my.cnf文件中的mysqld 下面添加如下行:
- skip_grant_tables
- 重启mysql服务, service mysql restart
- alter user 'root'@'localhost' identified by '123456';
- 如果做4报错,:The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
- 执行 flush privileges;
- ran再次执行alter user 'root'@'localhost' identified by '123456';
- update user set host='%' ; 设置可以任意ip登录
mysql8.0修改用户密码
最新推荐文章于 2024-04-14 11:17:30 发布