- Remove From My Forums
-
Question
-
was working before, cannot figure out what happened.
1. reboot pc
2. open MSSMS 2012
3. right click on «Databases», create new database
4. got error 5133
my c:, f: folders are read-write
Answers
-
-
Proposed as answer by
Thursday, July 11, 2013 2:32 AM
-
Marked as answer by
Fanny Liu
Tuesday, July 16, 2013 2:42 AM
-
Proposed as answer by
-
Hi,
The directory mentioned to create the database files is incorrect. It should be something like C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\db5.mdf
Thanks & Regards RAJUKIRAN L Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.
-
Proposed as answer by
Fanny Liu
Thursday, July 11, 2013 2:32 AM -
Marked as answer by
Fanny Liu
Tuesday, July 16, 2013 2:42 AM
-
Proposed as answer by
- Remove From My Forums
-
Вопрос
-
Hi,
I am unable to attach example database mdf file. It gives me error 5133 though I can create new database without any problem. The error says » Directory lookup for the file «c:\program Files\Microsoft SQL Server\MSSQL11.MSSSQLSERVER\MSSQL\DATA\AdventureWorks2012_Log.ldf»
failed with the operating system error 3 (the system cannot find the path specified). (Microsoft SQL Server, Error:5133)Thanks!
Syed
Ответы
-
-
Предложено в качестве ответа
8 января 2016 г. 8:57
-
Помечено в качестве ответа
Lydia ZhangMicrosoft contingent staff
15 января 2016 г. 9:28
-
Предложено в качестве ответа
Today I was having following error and found the work around
Create database failed with error 5133 on Microsoft SQL server 2012 With following ERROR
Microsoft SQL Server, Error: 5133
Msg 5170, Level 16, State 1, Line 1
Cannot create file ‘E:\SQL2012\MYDATABASENAME.mdf’ because it already exists. Change the file path or the file name, and retry the operation.
Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 911, Level 16, State 1, Line 1
Database ‘MYDATABASENAME’ does not exist. Make sure that the name is entered correctly.
OR
TITLE: Microsoft SQL Server Management Studio
——————————
Create failed for Database ‘MYMYDATABASENAME_0’. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476
——————————
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
——————————
Directory lookup for the file “D:\SQL2012\Tranlogs\MYMYDATABASENAME_0_log.ldf” failed with the operating system error 2(The system cannot find the file specified.).
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5133)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.3128&EvtSrc=MSSQLServer&EvtID=5133&LinkId=20476
——————————
BUTTONS:
OK
——————————
Work Around :
==
USE master
GO
— Drop the database if it already exists
IF EXISTS (
SELECT name
FROM sys.databases
WHERE name = N’MYDatabase_Name’
)
DROP DATABASE MYDatabase_Name
GO
CREATE DATABASE MYDatabase_Name
GO
Once you run this create database you will see the filepath of the database with error . Go to the Folder of the file Path and assaign full control permissions . Once you assaign the permission run the create database and you should not see any error now.
Referance
http://technet.microsoft.com/en-us/library/bb727008.aspx
Error: 5133 SQL Server while attaching the Database
Hi all,
One of my friend reported an error while trying to attached a database received from client to SQL SERVER 2008 R2.
The database received have only two files one is .mdf & second one is .ndf.
while attaching database to the server he was getting below error —
TITLE: Microsoft SQL Server Management Studio
——————————
Attach database failed for Server ‘XXX-XX—XX’. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2500.0+((KJ_PCU_Main).110617-0038+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
——————————
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
——————————
Directory lookup for the file «G:\SQLLOG\NAV_D_CQPA_370B_Log.ldf» failed with the operating system error 3(The system cannot find the path specified.). (Microsoft SQL Server, Error: 5133)
——————————
Resolution —
1) Check for the file path during attach.
In my case as i don’t have the Log File (.ldf) it was taking a random path which does not exist in the system.
2) Delete the selected file (in my case the log file) and click attach.
The system creates the missing file automatically.
Thanks & Regards,
Saurav Dhyani
http://saurav-nav.blogspot.com/
Popular posts from this blog
Hi All, In this article we will discuss the new introduced member of Dynamics Family. Yes you heard it correctly, one more new member with Name «Microsoft Dynamics 365» . #ProjectMadeira #Dynamics365
Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let’s link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer Table of Content here . If you have the old objects set let me brief you what I will be changing —
Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let’s discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions — 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.
Today I was having following error and found the work around
Create database failed with error 5133 on Microsoft SQL server 2012 With following ERROR
Microsoft SQL Server, Error: 5133
Msg 5170, Level 16, State 1, Line 1
Cannot create file ‘E:SQL2012MYDATABASENAME.mdf’ because it already exists. Change the file path or the file name, and retry the operation.
Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database ‘MYDATABASENAME’, the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 911, Level 16, State 1, Line 1
Database ‘MYDATABASENAME’ does not exist. Make sure that the name is entered correctly.
OR
TITLE: Microsoft SQL Server Management Studio
——————————
Create failed for Database ‘MYMYDATABASENAME_0’. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476
——————————
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
——————————
Directory lookup for the file “D:SQL2012TranlogsMYMYDATABASENAME_0_log.ldf” failed with the operating system error 2(The system cannot find the file specified.).
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5133)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.3128&EvtSrc=MSSQLServer&EvtID=5133&LinkId=20476
——————————
BUTTONS:
OK
——————————
Work Around :
==
USE master
GO
— Drop the database if it already exists
IF EXISTS (
SELECT name
FROM sys.databases
WHERE name = N’MYDatabase_Name’
)
DROP DATABASE MYDatabase_Name
GO
CREATE DATABASE MYDatabase_Name
GO
Once you run this create database you will see the filepath of the database with error . Go to the Folder of the file Path and assaign full control permissions . Once you assaign the permission run the create database and you should not see any error now.
Referance
http://technet.microsoft.com/en-us/library/bb727008.aspx
We got a new server recently and one of my colleagues ran into an error when restoring a database. The error was a quite generic (reformatted below for readability):
Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "C:UsersSQLTwinsDocumentsAdventureWorks2014AdventureWorks2014_Data.mdf" failed with the operating system error 5(Access is denied.). Msg 3156, Level 16, State 3, Line 1 File 'AdventureWorks2014_Data' cannot be restored to 'C:UsersSQLTwinsDocumentsAdventureWorks2014AdventureWorks2014_Data.mdf'. Use WITH MOVE to identify a valid location for the file.
My immediate reaction was to review the restore script.
USE [master]; GO RESTORE DATABASE [AdventureWorks2014] FROM DISK = 'C:Program FilesMicrosoft SQL ServerMSSQL13.MSSQLSERVERMSSQLBackupAdventureWorks2014.bak' WITH MOVE 'AdventureWorks2014_Data' TO 'C:UsersSQLTwinsDocumentsAdventureWorks2014AdventureWorks2014_Data.mdf', MOVE 'AdventureWorks2014_Log' TO 'C:UsersSQLTwinsDocumentsAdventureWorks2014AdventureWorks2014_Log.ldf'; GO
All looked well, I subsequently moved to the environmental aspect of troubleshooting. It was a new server and we had just created the target folders to which the database was to be restored.
We attempted to restore to the default database locations configured during SQL Server installation and the restore worked. So, one thing that became clear: the SQL Server service did not have appropriate security rights on the destination folder.
The Solution
Once we determined that it was the security rights on the destination folder, the only thing remaining was to grant the rights. Here’s how we do it.
- Cross-check the user set as the service user for Microsoft SQL Server database engine (use the SQL Server Configuration Manager for interacting with the SQL Server service – here’s why).
- Under Folder properties, ensure that this user has full security rights (or at least equivalent to the rights assigned on the default database folders specified at the time of installation)
Here’s are detailed screenshots showing the above process.
Identifying the user running the SQL Server Database Engine service
Navigating into file system folder security options to grant access to the SQL Server service
Choosing the appropriate account running the SQL Server service
Applying appropriate rights to folder
By the way: If you encounter similar issues in accessing your backup files, the root cause and solution are the same. Check the permissions on the folders housing your backups and you should see that the database engine does not have the necessary security rights.
Further Reading
Maintaining permissions on data folders and appropriate registry entries is something that is handled by the SQL Server Configuration Manager when you change the service account under which the database engine is running. If you use services.msc (the old way), this is not done and your SQL Server may stop working.
- Changing SQL Server Service Account or Password – Avoid restarting SQL Server [Blog Link]
- Blog Post #0344 – SQL Server – Missing Configuration Manager on Windows 8 [Blog Link]
Until we meet next time,
Be courteous. Drive responsibly.