LINUX
1.切换root 用户
2.停止mysqld 服务 /etc/inid.d mysqld stop
3.跳过验证登录 mysqld_safe --skip-grant-tables & (&表示后台运行)
4 mysql
5 user mysql;
6 update user set password=password("newpassword") where user='root';
7 flush privileges;
8 exit;
再次用新密码登录 成功!!