Chủ Nhật, 17 tháng 11, 2013

Reset MySQL root password

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ự.

0 nhận xét:

Đăng nhận xét