I am trying to backup database on sql server with :BACKUP DATABASE [mydb] TO DISK = N'/path/to/file.bak' WITH NOFORMAT, NOINIT, NOSKIP, REWIND, NOUNLOAD, STATS = 10
It creates backup if the path is /var/opt/mssql/data/file.bak cannot create backup in any other location. Is this a permission issue? Does any one had faced the same?
Thanks in advance.
SQL Server on Linux (on Ubuntu) runs under the user mssql. If you want SQL Server to be able to write to that folder, then either the user/group mssql needs write acces to the folder (and able to read/execute any parent folders), the mssql user needs to be part of a group that can, or the permissions for others needs to be set to write. Again, all parent folders need to allow access (read/execute).
If you had a Folder /backups, for example, owned by root: with the permissions 770, and then a folder /backups/SQLServer/ owned by root:mssql with the permission 775, then SQL Server would be unable to write to the folder, as it wouldn't have been able to navigate to the folder /backups.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With