Ubuntu下mysql忘记密码的解决办法
2012-05-29 21:22
323 查看
今天拿出以前的老机器,发现Mysql的密码早已忘的一干二净。搜了一下解决方案,发现下面的办法真实有效,共享之:
/etc/init.d/mysql stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
/etc/init.d/mysql restart
mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
/etc/init.d/mysql stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
/etc/init.d/mysql restart
mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
相关文章推荐
- ubuntu redhat mysql 忘记密码 解决办法
- ubuntu redhat mysql 忘记密码 解决办法
- Ubuntu下mysql忘记密码的解决办法
- ubuntu忘记密码的解决办法
- ubuntu 12.04忘记密码解决办法
- 忘记mysql密码的解决办法--针对windows系统
- ubuntu 忘记密码,忘记root密码的解决办法
- MySQL忘记密码处理方法解决办法
- MySQL在Windows平台下忘记root密码的解决办法
- MySQL忘记root密码的解决办法(Windows环境下)
- mysql忘记密码解决办法
- windows环境中mysql忘记root密码的解决办法
- MySQL忘记密码解决办法
- mysql密码忘记解决办法
- windows下忘记mysql超级管理员root密码的解决办法
- VMware中ubuntu忘记密码的解决办法[转]
- Ubuntu16.04忘记登录密码的解决办法。
- windows下mysql忘记root密码的解决办法
- Ubuntu 12.04 LTS server版忘记用户密码的解决办法
- 忘记MYSQL密码的解决办法