In single-user mode (boot while holding down command-S, or see the tip here on how to quit into single-user mode), remove /var/db/local.nidb, which is your local netinfo database. Also remove /var/db/.AppleSetupDone, then reboot. You will see a registration page again and can create a new admin account and go from there. Be careful to remap your privileges if necessary.
Also, if you are having problems with the database, but don't want to trash the whole thing, you can just remove /var/db/.AppleSetupDone and reboot. Go through the registration and create a new account with a DIFFERENT name than any you already have. This doesn't recreate the database, it just adds a new admin user to it.

