it might help someone else Googling and it took me forever to find. I could no longer login to my account after a few system crashes due to bad RAM during the login process.
If you are suffering from a so-called “login loop” in Mac OS X 10.7 Lion – ie. you login to your account and then suddenly you’re back at the login prompt again – your LaunchServices cache might be corrupt.
Follow Below steps for solve your Problem
Solution 1 Delete Keychain Access Password
Step 1) Restart Your Computer.
Step 2) Hold “Command+R” buttons just the moment your Mac starts up,
Step 3) Hold still…
Step 4) A window should appear, it says “Utilities…”
Step 5) From the tools menu, at the top, open “Terminal”
Step 6) In Terminal going to root folder.
Step 7) Fire Following command and file being deleted
Step 8) Reboot your machine
Step 9) insert your password and you solve your problem
Solution 2 Create New User via command line
Step 1) Reset ROOT Password for Mac OS X Lion:
- Restart your Mac,
- Hold “Command+R” buttons just the moment your Mac starts up,
- Hold still…
- A window should appear, it says “Utilities…”
- From the tools menu, at the top, open “Terminal”
- Type “resetpassword” and hit enter
- A new window opens, select the System Administrator account (root) option
- Set a new password, easy to remember for you,
- Confirm and close all the windows,
- A question will appear as would you like to restart?
Step 2) Login as ROOT on Mac OS X Lion:
- Let the Mac startup,
- At login screen, type the user name as “root” and put in the password you’ve chosen in step 1.8 above.
- Wait a while…
- You should be logged in with the “root” account to your Mac OS X Lion.
Step 3) Re-create your user (Reincarnation!)
- Right click on the “Finder” icon in the dock, select “Go to folder…”
- Type “/” and click on “GO” to go to your Mac’s hard drive,
- Navigate to the “Users” directory, you should see your own user folder, remember the folder’s name!
- Click the Apple logo on the left top side of the screen, select “System Preferences…”
- Go to “Users and Groups”
- Your user should not exist in the left side list, so click the small “+” button below the users list to add a new one.
- Set your Full name as it was previously (not very important though)
- Set the “Account name” EXACTLY AS THE FOLDER NAME YOU SAW IN STEP3.3 (VERY IMPORTANT)
- Set an easy to remember password for your account,
- And hit “Create User”
- Confirm on “using the Existing folder for Home…”
- Wait….until you see your user appear on the users list…
Step 4) Back on the Road:
- Restart your Mac
- Login to your own account easily and get all your data back!