Please take these steps to reset the root password.
Step 1
Boot into Recovery mode. The OS X Utilities screen will appear.
Step 2
Take this step only if you use FileVault 2. Launch Disk Utility, then select the icon of the FileVault boot volume ("Macintosh HD," unless you gave it a different name.) It will be nested below another icon with the same name. Click the Unlock button in the toolbar and enter your login password when prompted. Then quit Disk Utility to be returned to the main screen.
Step 3
Select
Utilities ▹ Terminal
from the menu bar. In the window that opens, type this:
res
Press the tab key. The partial command you typed will automatically be completed to this:
resetpassword
Press return. A Reset Password window opens. Select your boot volume if not already selected. Pull down the menu labeled Select the user account and select
System Administrator (root)
Follow the prompts to set a password. It's safest to choose a password that includes only the characters a-z, A-Z, and 0-9.
Select
▹ Restart
from the menu bar.
Step 4
Follow the instructions in this support article under the heading "Disable the root user."