【MySQL】密码重置
- 管理员启动cmd,输入"net stop mysql"关闭mysql服务
- 修改mysql安装路径下的配置文件 my.ini,在 [mysqld] 后添加"skip-grant-tables"
- 启动mysql服务,net start mysql
- 登录root用户:mysql -uroot -p
- 修改密码,依次输入:
use mysql;
update user set authentication_string = password(‘12345’) where user = ‘root’;
(这里的12345为新密码) - 输入 \q 退出mysql
- 关闭mysql服务,删除 skip-grant-tables
- 启动mysql服务,用新密码登录