重置mysql用户密码

刚装完的mysql数据库出现了如下错误:
ERROR 1045 (28000): Access denied for user ‘root‘@’localhost’ (using password: NO)
参考了这篇博文:
http://www.cnblogs.com/khler/archive/2011/02/10/1950819.html
用下面的语句解决了问题

1
2
3
4
5
6
7
8
/etc/init.d/mysql stop 
mysqld_safe --skip-grant-tables&
mysql --user=root mysql
mysql>update user set Password=PASSWORD('new-password');
mysql>flush privileges;
mysql>exit;
killall mysqld_safe&
/etc/init.d/mysql start
md5碰撞脚本 metasploit攻击载荷独立封装和编码
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×