Fixing the “SET PASSWORD has no significance for user root@localhost” error in Linux


First you need to understand the reason for this error. The “SET PASSWORD has no significance for user root@localhost” error can occur due to several reasons. These reasons are completely different and may be
related to security settings, user privileges, or other factors.

This “SET PASSWORD has no significance for user root@localhost” error most likely indicates that the MySQL server does not allow you to change the password for the root@localhost user when you use the SET PASSWORD command. Before you begin solving the problem, you need and it is important to make sure that the root@localhost user has sufficient privileges to change the password. You should then log into your MySQL using your superuser credentials:

mysql -u root -p 
Then, after logging in, a very important step will follow – checking the root@localhost user privilege. This can be done using the following command:
SHOW GRANTS FOR 'root'@'localhost';
It may also turn out that the user does not have sufficient privileges to perform the operation. You have the option to do this, just enter the following:
  • set_new_passwd – will be the actual value of your new password. Create a complex password and substitute this value here.

Next you should check your MySQL configuration files. They are usually called my.cnf or my.ini. It is worth checking for security settings that may restrict password changes for the root@localhost user. Check your security and authentication related settings.

In the case of the SET PASSWORD alternative, you can try using another method to change the password. Login to MySQL and use the following query:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'set_new_passwd';