If you forget the mysql root password, you can easily reset it. Do the following as root on the server that mysql is running on.
1. Stop mysqld
2. Restart it manually with the --skip-grant-tables option.
shell> mysqld_safe --skip-grant-tables &
3. Connect to the mysqld server with this command:
4. Issue the following statements in the mysql client. Replace the password with the password that you want to use.
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
-> WHERE User='root';
mysql> FLUSH PRIVILEGES;
5. Kill the mysql you started (from the same shell you started it, it should be background job 1)
shell> kill %1
6. Wait 5-10 seconds, then start mysql normally
shell> /etc/init.d/mysqld start
You should now be able to connect to MySQL as root using the new password.