1、centos7节点安装sqlserver
1.1 下载官网的yum源
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo
1.2 yum安装sqlserver
yum install -y mssql-server
1.3 启动sqlserver服务,并配置密码、版本等信息
/opt/mssql/bin/mssql-conf setup
1.4 安装 SQL Server 命令行工具
curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
1.5 删除所有旧的 unixODBC
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel
1.6 安装 mssql-tools unixODBC-devel包
yum install -y mssql-tools unixODBC-devel
1.7 PATH 环境变量添加 /opt/mssql-tools/bin/
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
1.8 连接数据库
sqlcmd -S localhost -U SA -P '<YourPassword>'
# 如果成功,应会显示 sqlcmd 命令提示符:1>
1.9 总结