This is supposed to be a concise tutorial and you should not spend longer than 10 minutes to go through it.
After trying many approaches, the following steps work with me:
sudo mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';
sudo service mysql restart
The following lists approaches I had tried, which didn't work with me. However, you may try as they may work on your machines:
Of course, the solution may differ from MySQL versions to versions.
This tutorial is summarized and is revised from:
Other blogged posts >> Tutorials