[英]SQL Server on Ubuntu 18.04 Operating system error 2(The system cannot find the file specified.)
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
我正在尝试在 sql server 上备份数据库: 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.如果路径为/var/opt/mssql/data/file.bak
则创建备份无法在任何其他位置创建备份。 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
. Linux(在 Ubuntu 上)上的 SQL Server 在用户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.如果您希望 SQL Server 能够写入该文件夹,则用户/组mssql
需要对该文件夹进行写入访问(并且能够读取/执行任何父文件夹),则mssql
用户需要成为该组的一部分可以,或者需要设置其他人的权限才能写。 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
.如果您有一个文件夹/backups
,例如,由root:
拥有,权限为770
,然后文件夹/backups/SQLServer/
由root:mssql
拥有,权限为775
,则 SQL Server 将无法写入该文件夹,因为它无法导航到文件夹/backups
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.