filmov
tv
Reset MySQL root user password ('ERROR 1045 (28000): Access denied for user 'root'@'localhost' ')
Показать описание
A another super user with appropriate privileges can change the root password in MySQL. Additionally, users with the SUPER privilege or the GRANT OPTION privilege can modify the root user's password.
Connect to MySQL:
Connect to the MySQL server using a user with sufficient privileges, such as a user with the GRANT OPTION privilege.
Change Password:
Use the following ALTER USER command to update the root user's password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
Flush Privileges:
After updating the password, run the following command to flush privileges:
FLUSH PRIVILEGES;
Connect to MySQL:
Connect to the MySQL server using a user with sufficient privileges, such as a user with the GRANT OPTION privilege.
Change Password:
Use the following ALTER USER command to update the root user's password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
Flush Privileges:
After updating the password, run the following command to flush privileges:
FLUSH PRIVILEGES;