Reset MySQL root password

0

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

Xem thêm: ten mien, tra cuu ten mien, vps, hosting gia re

Leave a Reply

Your email address will not be published. Required fields are marked *