centos7版本:CentOS-7-x86_64-Minimal-2009
参考:https://learn.microsoft.com/zh-cn/sql/linux/quickstart-install-connect-red-hat?view=sql-server-ver16
1.下载 SQL Server 2022 (16.x) 预览版 Red Hat 存储库配置文件
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-preview.repo
2.安装 SQL Server
sudo yum install -y mssql-server
3.配置sql server
sudo /opt/mssql/bin/mssql-conf setup
4.如果提示缺少依赖的glibc2.18和glibc2.27,升级glibc到2.31再重复步骤3
升级gcc:(参考:https://blog.whsir.com/post-4975.html)
yum install centos-release-scl
yum install devtoolset-8
scl enable devtoolset-8 bash
此时通过gcc --version命令可以看到,gcc版本已经变成8.x.x,值得注意的是这仅仅在当前bash生效,如果需要永久生效,请自行添加环境变量
升级glibc:(参考:https://blog.csdn.net/yutenys/article/details/122154162)
cd /opt
wget https://mirrors.aliyun.com/gnu/glibc/glibc-2.31.tar.gz
tar -zxf glibc-2.31.tar.gz
cd glibc-2.31/
cat INSTALL | grep -E "newer|later"
mkdir build
cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin --disable-sanity-checks --disable-werror
yum install python3 #python2安装会报错的
make -j6
make install
make localedata/install-locales
验证版本:
strings /lib64/libc.so.6 | grep GLIBC
ll /lib64/libc.so*
5.启用代理服务
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
sudo systemctl restart mssql-server