清空密码:打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”,保存并关闭文件。
- 重启MySQL服务
net stop MYSQL
net start MYSQL
执行“use mysql;”,使用mysql数据库。
更改密码update mysql.user set authentication_string=password('root') where user='root'
清空密码:打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”,保存并关闭文件。
net stop MYSQL
net start MYSQL
执行“use mysql;”,使用mysql数据库。
更改密码update mysql.user set authentication_string=password('root') where user='root'