Change the password in single user mode
- Hold ⌘S on startup
- mount -uw / (fsck -fy is not needed)
- launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist (or /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist in 10.6)
- dscl . passwd /Users/username (without a trailing slash) and enter a new password. You can ignore the error about com.apple.DirectoryServices.plist.
- reboot
- Hold ⌘S on startup
- mount -uw / (fsck -fy is not needed)
- rm /var/db/.AppleSetupDone
- reboot
- Go through the steps of creating a new account. You can leave all fields in the personal information step blank
- After logging in on the new account, go to the Users & Groups preference pane
- Select the old account, press the Reset Password... button, and enter a new password
- Hold ⌘R on startup
- Open Terminal from the Utilities menu
- Type resetpassword and follow the instructions