下面以在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 |