Skip to Content

How to set MySQL root password

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.

Follow the below steps to fix the above error or set the MySQL root password.

1. Login to MySQL 8.0 and run the below command to set a password for the root user.

[email protected] ~]# mysql

mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'password';

mysql> flush privileges;

mysql> exit;

2. Login to MySQL 8.0 as the root user and run the below command to change the root user’s authentication method back to the default.

[email protected] ~]# mysql -u root -p

Enter password: 

mysql> alter user 'root'@'localhost' identified with auth_socket;

mysql> flush privileges;

mysql> exit;

3. Restart MySQL server and continue installing Ezeelogin.

[email protected] ~]# systemctl restart mysql

 

Related Information

ERROR creating DB user in MySQL 8.0