sudo yum update -y
sudo yum install -y wget openssl11-devel libaio libcurl libxml2-devel bzip2-devel libjpeg-turbo-devel freetype-devel libpng-devel
sudo curl -o /etc/yum.repos.d/mssql-release.repo https://packages.microsoft.com/config/rhel/7/prod.repo
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo yum install -y mssql-server
sudo yum install -y msodbcsql17 unixodbc-devel
sudo /opt/mssql/bin/mssql-conf setup
ls /opt/mssql/ # 應顯示SQL Server安裝目錄
sudo systemctl start mssql-server
sudo systemctl enable mssql-server
sudo systemctl status mssql-server
sqlcmd -S localhost -U sa -P YourPassword
SELECT @@VERSION; -- 應返回SQL Server版本信息
GO
EXIT; -- 退出sqlcmd
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload
USE master;
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'Agent XPs', 1;
RECONFIGURE;
https://packages.microsoft.com/config/rhel/8/prod.repo
)。