Given that the data directory of the server is empty:
The server is initialized.
SSL certificate and key files are generated in the data directory.
The validate_password plugin is installed and enabled.
The superuser account 'root'@'localhost' is created. The password for the superuser is set ...
To reveal the default "root" password:
shell> sudo grep 'temporary password' /var/log/mysqld.log
Change the root password as soon as possible by logging in with the generated temporary password and set a custom password for the superuser account:
shell> mysql -uroot -p
mysql...
if I forget the password then I'll get error.
$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I tried to solve the issue by first knowing the status:
$ systemctl status mysql.service
mysql.service - MySQL Community ...