In this article, we will find the solution for the below 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.
Solution is
1. By running sudo mysql which logged me in as root without a password
2. Then I ran ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password by ‘PassWord@123’;
3. kill the process id of mysql_secure_installation.
4. Now run the sudo mysql_secure_installation.
The above 4 steps will fix the error in MySQL on Linux.