Forgetting passwords isn't generally a good idea. It does happen, though, and if it happens to your MySQL server, this is the process you need to follow in order to recover it.
First of all, you need to stop the running MySQL server. You need to be root on your system, then:
# /etc/init.d/mysql stop
Now, we need to make a text file called an init file. The contents of this file will be executed in a moment when we restart the MySQL server in a special way. So, create a new text file in your home folder and place this in the file:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword');
Obviously, substitute in your desired password (leaving the quotes intact). Save the file as passwordinit.
Now, we need to start the MySQL server with this init file. Still as root on the system, run:
# mysqld_safe --init-file=~/passwordinit &
As soon as you press Enter, the password has been changed. Now I recommend restarting the MySQL server in the normal way, as follows:
# /etc/init.d/mysql restart
And that's it. Be more careful next time.

Sun Microsystems CEO Jonathan Schwartz has announced on his blog that Sun are acquiring MySQL AB, the parent company and commercial arm of popular relational database system MySQL.
... we're putting a billion dollars behind the M in LAMP. If you're an industry insider, you'll know what that means - we're acquiring MySQL AB, the company behind MySQL, the world's most popular open source database... So what are we announcing today? That in addition to acquiring MySQL, Sun will be unveiling new global support offerings into the MySQL marketplace. We'll be investing in both the community, and the marketplace - to accelerate the industry's phase change away from proprietary technology to the new world of open web platforms.
This is a very important development and definitely proves what we already know - that the MySQL database system is a critical part of the modern web. Sun clearly recognise that and it is encouraging that they are putting serious resources behind it.
One of the possible benefits this might bring about is that businesses that are currently on the fence about choosing an open source solution because of a relatively small company doing the support may well end up going for MySQL if they can get enterprise support from a big name like Sun.
Also, I'm sure that one of the motivations for this move is that owning MySQL will allow Sun to better integrate it into their product portfolio. Having control means they can work hard to make MySQL work really well on their hardware platforms and on Solaris and provide even better blended support for it. Which strengthens the case for Solaris and perhaps their hardware too.
Of course, this doesn't mean anything bad for existing deployments on platforms like Linux. Sun has clearly shown that it genuinely wants to work to make things work on any platform, even platforms that compete with theirs. Unlike some companies I could mention.
The bottom line is - this looks like a very positive move for MySQL as an enterprise product and with any luck should increase enterprise usage of MySQL and therefore strengthen open source in general.
A quick walkthrough of the installation of Moodle on an Ubuntu Gutsy system (using MySQL as the database type).