Instructions according to MySQL Documentation
Now restart mysqld with the --skip-grant-tables option and set a new password. There are two alternatives:
That's as simple as
mysqladmin -u root password 'mynewpassword' mysqladmin -h hostname flush-privileges
You should now be able to connect using the new password. You can now stop mysqld and restart it normally.
mysql in some configurations can log all database activity to a binary log file (usually in /var/lib/mysql). If you have a busy site this can grow quite large. The recommended management solution in the mysql manual is to remove binary log files that you no longer want. They suggest removing files that are older than 3 days. To remove all binary log files you can use the following command
RESET MASTER;
One page links to MySQLNotes: