简体   繁体   中英

How to take backup(.bak) in SQL Server on linux

I can not take backup .bak from my database in Linux ubuntu

See this image I want to backup from conn1 database: CarSaleDatabase

图片

I run this

USE CarSaleDatabase
GO 

BACKUP DATABASE CarSaleDatabase
TO DISK = '/home/mohammadsgh/github/ddblab.bak'

but I get this error:

Msg 3201, Level 16, State 1, Line 5 Cannot open backup device '/home/mohammadsgh/github/ddblab.bak'. Operating system error 5(Access is denied.). Msg 3013, Level 16, State 1, Line 5 BACKUP DATABASE is terminating abnormally.

How can I do this?

First step

create .bak file:

touch db.bak

second step:

sudo chmod 777 db.bak

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM