MSSQL Server 2017 for Linux 安装测试
安装
#sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
#sudo yum install -y mssql-server
#sudo /opt/mssql/bin/mssql-conf setup
#systemctl status mssql-server
#sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
#sudo firewall-cmd --reload
#sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
#sudo yum remove unixODBC-utf16 unixODBC-utf16-devel
#sudo yum install -y mssql-tools unixODBC-devel
#echo ‘export PATH=“KaTeX parse error: Expected 'EOF', got '#' at position 48: …/.bash_profile #̲echo 'export PA…PATH:/opt/mssql-tools/bin”’ >> ~/.bashrc
#source ~/.bashrc
#source ~/.bash_profile
测试
#sqlcmd -S 127.0.0.1 -U SA -P ‘ABCDabcd123@#¥’
CREATE DATABASE TestDB
GO
SELECT Name from sys.Databases
GO
USE TestDB
GO
CREATE TABLE Inventory (id INT, name NVARCHAR(50), quantity INT)
GO
INSERT INTO Inventory VALUES (1, ‘banana’, 150); INSERT INTO Inventory VALUES (2, ‘orange’, 154);
GO
SELECT * FROM Inventory WHERE quantity > 152;
GO
QUIT