Edit the conf file
sudo vi /etc/my.cnf
Add line to mysqld block.*
skip-grant-tables
Save and exit.
Restart MySQL service.
sudo systemctl restart mysqld
Check Service status
sudo systemctl status mysqld
Connect to My SQL
mysql
Switch main database.
use mysql;
Redefine user root password.
UPDATE user SET `authentication_string` = PASSWORD('mySuperSecretPassword1') WHERE `User` = 'root';
Edit file my.cnf.
sudo vi /etc/my.cnf
remove line
skip-grant-tables
restart MYSQL Service