I'm getting an error when I ran mysql_secure_installation
I keep getting the following error on running
... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.
Any help will be appreciated.
Please follow below steps to fix the error.
Login as a root user without using any password
Then use the following command to change the authentication parameter:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword'
mynewpasswordis the new password you have set for root user, it would help to access and run installation again.
mysql_secure_installationto secure MySQL
once asked, enter the new set password for root user you recently did.
Check for more details on https://dev.mysql.com/doc/internals/en/authentication-method.html ,https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_authentication_methods.html