在Windows系统上为例,linux上将步骤2的mysqld-nt换为safe_mysqld即可
1 、停止mysql5服务net stop mysql5
2、开一个DOS窗口执行
c:\mysql\bin mysqld-nt --skip-grant-tables &
3、再开一个DOS窗口执行
c:\mysql\bin mysql mysql
update user set password = password('123456') where user = 'root';
root密码即为设置为123456
4、启动mysql5服务
net start mysql5
2010-4-23 下午 11:23:35 回复该留言
学习了,好方法