You must reset your password using ALTER USER

On MySQL 8, when you start MySQL, it generate a temporary root password, that you can find with command

grep 'temporary password' /var/log/mysqld.log

When i try run some SQL commands after login with this temporary password, i get error

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

Advertisement

To fix this, you need to change your MySQL root password by running

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

MySQL 8 on CentOS Change MySQL Root Password

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement