MySQL忘记root密码

Windows下恢复root用户
 
net stop mysql
cd mysql/bin /
mysql/bin/mysqld-nt --skip-grant-tables /*不要关闭
mysql/bin/mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
> use mysql
> update user set password= password("new_pass") where user="root";
> flush privileges;
> exit

结束mysqld-nt进程。
net start mysql

你可能感兴趣的:(mysql,数据库,职场,休闲)