What is stopping you from copying the mdf and ldf files locally and attaching. SQL Server engine would need permission on folder where mdf resides. It would need read and write permission. In your case that is not possible. I would suggest copy it locally and attach. Is this AWS ?
can't attach database with remote mdf file
I want to attach database using mdf file. The mdf file is not in local computer. It can be access using window file explorer with address like \nbapp637...\model.mdf with username and password. And I also add the username and password to credential manager. But when I attach the database, it fails with error . It seems that mssql can not get the username and password in credential manager, so that can't attach the database.
3 answers
Sort by: Most helpful
-
-
AmeliaGu-MSFT 13,976 Reputation points Microsoft Vendor
2020-10-29T02:20:58.073+00:00 Hi @Hui Wang ,
Could you please check if the SQL Server service account has enough rights to read/write this sharing file?
Or you can try to copy the files to default location for Database Engine data files (\Program Files\Microsoft SQL Server\MSSQL1x. \MSSQL\DATA).
Please refer to this similar thread which might help.Best Regards,
Amelia
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Users always get connection timeout problem when using multi subnet AG via listener. Especially after failover to another subnet -
Ben Miller (DBAduck) 956 Reputation points
2020-10-29T02:33:52.757+00:00 You are right. SQL Server will not be able to get the credential and use it to get to the share for the SQL Server database file. You need to either configure it so that the SQL Server service account has access to the file on the share without using a username / password or you need to figure out another way (copy it locally or otherwise)
Shares require Windows Auth access by the SQL Server service account.