If you cannot login to your accoount on iMac, Macbook, Mac Mini or MacPro, the following How-To might save your day. I found the following How-To article from MacWorld.com . It is advisable to use it only when required, I myself do not test all the options given except for number one.
Options to recover your password on iMac, Macbook, Mac Mini or MacPro:
- Change it from an admin account: A graphical user interface to reset your own password or others people account
- Use Single-User mode: Reset by using root access during reboot
- Use an Apple ID: When you first setup your OSX devices, you were ask either to allow your Apple ID to be used as password recovery account. If you allow, it will save a lot of your time
- Use Recovery Mode: Entering recovery mode during reboot.
If you want try the above options, make sure you are not using your main account. Your data maybe wiped during the recovery process. For full details with pictures, please go through it in Macworld.com