티스토리 뷰

[SQL Server] How to change MSSQL Server data folder on Linux

 

# stop the mssql server service
systemctl stop mssql-server

# make your own new mssql data folder and log folder
mkdir /data/mssql/data
mkdir /data/mssql/log

# check the mssql binary path
ls /opt/mssql/bin

# change the mssql data folder
sudo /opt/mssql/bin/mssql-conf set filelocation.defaultdatadir /data/mssql/data

# change the mssql log folder
sudo /opt/mssql/bin/mssql-conf set filelocation.defaultlogdir /data/mssql/log

#copy all file in the default data and log folder to your own new data and log folder
sudo cp -r /var/opt/mssql/data/* /data/mssql/data
sudo cp -r /var/opt/mssql/log/* /data/mssql/log

#change ownership of data and log files
sudo chown -R mssql:mssql /data/mssql

#restart the mssql server service
systemctl start mssql-server

'Database > MS SQL Server' 카테고리의 다른 글

[SQL Server] How to use MSSQL Server custom port on Linux  (0) 2023.03.08
[SQL Server] MSSQL CLI Backup  (0) 2021.08.24
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함