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.
To fix this, you need to change your MySQL root password by running
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD';
Leave a Reply