I have installed CentOS 8
and a mysql 8
.
When I try to have an access to it for the first time,
mysql -u root -p
I will be asked for the password and whatever I try, I face with an error
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Were to find my password for the first time?
For a fresh installation of mysql 8
, you can find your temporary password by this command:
sudo grep 'temporary password' /var/log/mysqld.log
Now, that you have the temporary password,
mysql -u root -p
and then
alter user root@localhost identified by 'your-new-password'; flush privileges;