SQL server 2019 on Centos 7 x86_64. It was running fine for quite long time, then got broken. I was not doing anything special, neither update or restart or whatever. At some point the database went offline, and in errorlog I see these lines every time when I try to bring db online:

FCB::Open failed: Could not open file /var/opt/mssql/data/base.mdf for file number 1. OS error: 5(Access is denied.). Unable to open the physical file "/var/opt/mssql/data/base.mdf". Operating system error 5: "5(Access is denied.)".

I tried to su into mssql user. All files and paths were accessible. selinux is disabled on that machine.

I then tried to run sql service as root. Still same problem (root cannot get access to files?)

Tried to make all files 777. Tried to reboot in case someone is holding some lock or whatever. No luck. At this point I think that it is some weird bug in mssql and it just blames OS.

Dropped the base and restored from backup with same name and same file locations. Worked without any warning, and works ever since.

I would appreciate if anyone could share some wisdom as of what could be happening there, because even though the problem was easily solved, I really don't like to deal with haunted servers.

1 Answer 1


This is definitely interesting. Normally, Access is denied error is due to changed/missing permission on the file. Did you see any related errors in journalctl?

If it happens again, I'd raise a ticket with Microsoft.

  • 2
    Hey krislinux - this doesn't really answer the question. When you have enough rep you can comment to ask for clarification, but until then try to avoid asking more questions in the format of an answer. Commented Aug 27, 2020 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.