March 7, 2014 · Ubuntu 16.04 MySQL 5.7 Quick & Easy password reset
Quick & Easy: Reset MySQL root Password (Ubuntu 16.04)
service mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
flush privileges;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
quit
pkill -9 mysqld
service mysql restart
mysql -u root -p