When trying to install
mysql_secure_installation in Ubuntu, we face following error.
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
To alter the authentication settings, simply execute this command first.
Then execute this ALTER Query to modify the authentication settings.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';
And now, we will be able to run
Now, Error might have been solved.
But If you are facing following error after above command then:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
There are three possible solutions to this error.
- The first is to choose a strong password, such as Herak@196**$, which will meet current policy criteria.
2. The second option is to just uninstall the validate password plugin using these two instructions.
mysql -h localhost -u root -p
and then, uninstall the plugin
3. The third solution is You can set
validate_password.policy to low, so Just run
and then run
SET GLOBAL validate_password.policy=LOW;
And now the error is solved.