how to enable mysql 5.7 root user password on linux 1

how to enable mysql 5.7 root user password on linux

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SOME_NEW_ROOT_PASSWORD';

Here is what the above code is Doing:
1. We’re using the mysql client to connect to the database server.
2. We’re using the USE command to select the database we want to work with.
3. We’re using the ALTER USER command to change the password for the root user.
4. We’re using the IDENTIFIED WITH mysql_native_password BY clause to change the authentication method for the root user.
5. We’re using the ‘SOME_NEW_ROOT_PASSWORD’ string to set the new password for the root user.

Similar Posts