Try the manual.
It has a section on resetting the root password.
Basically you restart the server with --skip-grant-tables option
Check out chapter 20.11
Adam Cripps wrote:
>I'm locked out of mysql database - it seems that all my users can't access
>it, through lack of privileges, even root. This means that I can't get
>through and change the privileges.
>
>How can I start with a fresh users database?
>
>I'm only setting the database up at the moment, so there's no data to lose.
>
>
>I've tried mysqladmin_fix_privileges_tables and I've tried
>mysqladmin_install_db
>
>but nothing seems to work.
>
>Also, the actual mysql database itself has no tables. How can I restore
>that?
>
>Any ideas?
>
>Thanks in advance.
>
>