(1)如果 MySQL 正在运行,首先杀之:
killall -TERM mysqld
(2)启动 MySQL :
/usr/bin/safe_mysqld --skip-grant-tables &
就可以不需要密码就进入 MySQL 了
(3)然后就是
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
或
shell>mysqladmin -u root flush-privileges password "newpassword"
(4)重新杀 MySQL ,用正常方法启动 MySQL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment