Trong trường hợp bạn quên mất mật khẩu root MySQL, hãy thực hiện theo các bước sau để reset lại mật khẩu này.
Stop MySQL service
sudo /etc/init.d/mysql stop
Start mysqld
sudo mysqld --skip-grant-tables &
Đăng nhập mysql dưới quyền root:
mysql -u root mysql
Thay thế your_new_password bằng mật khẩu mới:
UPDATE user SET Password=PASSWORD('your_new_password') WHERE User='root'; FLUSH PRIVILEGES; exit;
Các thao tác trên CentOS cũng tương tự.

nguồn: http://hocvps .com/reset-mysql-root-password/
Share To:

Post A Comment:

0 comments so far,add yours