Create a new admin account in single user mode.

This is useful if for some reason a user has become corrupted or simply wont complete the login sequence for any reason.  It is non-destructive to existing data.  So it is safe to use as a means for gaining access with admin rights to perform further actions on the OS.

power on your machine and press command S as soon as you hear the chime.
(assumes no firmware password set)

at the shell prompt type the following :

“/sbin/fsck -fy”

this runs fsck kinda like disk utility repair feature to check your file
system for corruption.

when fsck is finished type:

“/sbin/mount -uw /”

this sets your hard drive to allow changes.

now type these commands in succession pressing return after each line.

“rm /var/db/.AppleSetupDone”
“reboot”

this will run the mac os x account setup assistant at boot and create a
new mac os x user account for you with admin rights.

you can use this account to find out the user name for your other account
and reset its password.