Set MySQL Root Password

To reset the MySQL root password, login to the mysql shell and run the following commands.

SET PASSWORD FOR root@localhost=PASSWORD(’RootPasswordHere’);
FLUSH PRIVILEGES;

Grant MySQL Privileges

To grant all privileges to a user from any location login to the mysql shell and run the following queries.

GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY ‘PasswordHere’ WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO username@"%" IDENTIFIED BY ‘PasswordHere’ WITH GRANT OPTION;
FLUSH PRIVILEGES;