MSSQL Server 2017 for Linux 安装测试

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值