reset mysql root password

  1. stop mysql: http://stackoverflow.com/questions/18733944/ubuntu-cant-stop-mysqld
  2. reset password: https://www.digitalocean.com/community/questions/setup-mysql-on-ubuntu-droplet-getting-error-error-1045-28000-access-denied-for-user-root-localhost-using-password-yes

where to store the password of ‘root’?

use ~/.my.cnf to store User _specific options

[client]
user=root
password=somepassword
- 2016-03-18 edit