mysql修改root密码
1、如果知道root密码:
mysql -u root -p
输入密码
use mysql;
UPDATE
user
SET
Password
=
PASSWORD
(
'newpass'
)
WHERE
user
=
'root'
;
FLUSH
PRIVILEGES
;
quit;
2、如果不知道密码
service mysqld stop;
mysqld_safe
--skip-grant-tables&
mysql -u root mysql;
UPDATE
user
SET
password
=
PASSWORD
(
"new password"
)
WHERE
user
=
'root'
;
FLUSH
PRIVILEGES
;
password字段没有的话:
update mysql.user set authentication_string=password('新密码') where user='root';
FLUSH
PRIVILEGES
;
邮箱:wangh_2@sina.com