Unable to access MySQL console as ROOT due to lost and/or unknown password.
Attempted to reset the password by following the below KB article, however, it appears not working with MySQL 8.x version.
https://knowledge.broadcom.com/external/article/92946/how-to-reset-mysql-internal-root-passwor.html
The procedure to reset DB Root password is slightly different in MySQL 8.x from what used to be in MySQL 5.x.
Release : 10.0
Component :
Start MySQL service with the --skip-grant-tables option and alter the ROOT password with the following steps:
# systemctl stop mysqld.service
# mysqld --skip-grant-tables --user=mysql &
# mysql
# FLUSH PRIVILEGES;
# ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
# systemctl stop mysqld.service
# systemctl start mysqld.service
Please, do not forget to update /root/.my.cnf file with the new password if you store it under the OS user profile.