I recently got email from friend who had suffered from following error.
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file “filepath” failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file “filepath” failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
As per him he had gone crazy to find solution. He had been trying to create database and he had all the admin privileges. After getting remote desktop, I realize that he was everything correct but the filepath he was trying to create. Once he corrected the filepath everything was smooth from there.
If you have the same error I suggest you carefully check your filepath. There must be some typo or error in filepath. If that is not the case and with admin rights you are still facing issue, post a comment here.
Reference: Pinal Dave (http://blog.SQLAuthority.com)












Most of the time people use local system’s path and not the server’s path which leads to this error
This is like “check that the device is plugged in”. Nothing to blog about.
I already get this error and the paths were right. I was trying to create database in a path like this: C:\programs\MyProgram\MyProgram.mdb and what solves my problem was runnig sql server not by local account but by using a computer account. Is this the macthing of the admin privileges??
Reagards.
Check the service account SQL Server is running on. If it is using Network Services, change it to Local System or windows admin account.
verify that you created the folders in the path
verify that your session runs by windows authentication or damain account that had permission on created Folders
As above: permission error on folder, not incorrect path
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file “filepath” failed with the operating system error 2(The system cannot find the file specified.).
am getting the same error msg ihave tried to run in Admin mode also, i have check my file path everything is good, But still am getting this error. can you tell me why?
FIX: I was importing a .BAK file from Microsoft SQL Server Management Studio Express and kept getting the error: Directory lookup for the file “C:\\MSSQLDB\\mydatabase.mdf” failed with the operating system error 2.
This was regardless of the fact that I was importing the .BAK file from a completely different location!
After not having any luck with more logical solutions…I tried creating a \”C:\\MSSQLDB\” folder and moving my BAK file into that folder. (folder didn\’t exist before)
This ended up working and my database imported successfully.
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file “E:\db_SqlDatafiles\Trustbank_VMUCB_Warora1.ldf” failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Line 2
File ‘Trustbank_Hinganghat_Branch_log1′ cannot be restored to ‘E:\db_SqlDatafiles\Trustbank_VMUCB_Warora1.ldf’. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 2
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.
Directory lookup for the file “E:\SQLDATA\DATA\HMS_DB_OOCE.mdf” failed with the operating system error 3(The system cannot find the path specified.).
I got this error when trying to execute script from one system in another system.
Spot on!! Thank you Pianldave!!!