10 2010

centos中mysql重置密码

Published by 笨二十一 at 12:26 下午 under MySQL,Web技术

mysql YUM 安装路径rpm -ql mysql (usr/bin)

方法:

# /etc/init.d/mysqld 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/mysqld restart
# mysql -uroot -p

No responses yet

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.