Stop MySQL Database
systemctl stop mysqld.service
Start MySQL as Safe Mode
mysqld_safe –skip-grant-tables &
Connect MySQL Database With Root User
mysql -uroot
Change Root Password
use mysql;
update user set password=PASSWORD(“newpassword”) where user=’root’;
flush privileges;
exit
Restart MySQL Database
systemctl stop mysqld.service
systemctl start mysqld.service
Connect MySQL Database With Root User With New Password
mysql -u root -p