How to reset forgoten mysql root password

It is very frustrating when you can not remember your mysql password, but don’t panic there is a quick way to reset it and it only takes one minute. This should work on CentOS 6 and 7 and RedHat distributions.