How to change root password in mysql

In order to change root password in mysql, follow this process

Process

1. Once MySql is installed execute this command

mysqladmin -u root -p'yOOQwiwpI7&q' password '1969'

This changes the password 

  • from : yOOQwiwpI7&q
  • to     : 1969

login into mysql as root without sudo

sudo mysql -u root
mysql> DROP USER 'root'@'localhost';
mysql> CREATE USER 'root'@'%' IDENTIFIED BY '';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
mysql> FLUSH PRIVILEGES;

​Reference

https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-fro...