1. mysql -uroot -p
2. use mysql;
3. update user set authentication_string='' where user='root';
4. alter user 'root'@'localhost' identified by 'newpassword';
5. flush privileges;