If you need to reset/forgot your password of MYSQL server, go through follow steps and terminal commands.
1.Stop the mysqld server if it is already running.
2.Run the server in safe mode with privilege bypass.
sudo mysqld_safe --skip-grant-tables
3.In a new window connect to the database, set a new password and flush the permissions & quit:
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
4.Stop the safe mode server and start your regular server back.