### 下载安装
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo && sudo yum install -y mssql-server
### 执行配置
sudo /opt/mssql/bin/mssql-conf setup
### 解决libc.so.6: version `GLIBC_2.18‘ not found问题
没有GLIBC_2.18
下载:wget http://mirrors.ustc.edu.cn/gnu/libc/glibc-2.18.tar.gz
解压:tar -zxvf glibc-2.18.tar.gz
进入解压文件夹,创建文件夹build:
wget http://mirrors.ustc.edu.cn/gnu/libc/glibc-2.18.tar.gz && tar -zxvf glibc-2.18.tar.gz && cd glibc-2.18 && mkdir build && cd build
运行configure配置,make,sudo make install
../configure --prefix=/usr make -j4 sudo make install
### 修复安装文件配置中的字符编码错误
修改 /opt/mssql/lib/mssql-conf/mssqlconfhelper.py的以下部分
修改前
if(noprompt == False): language = locale.getdefaultlocale()[0] if(language == None or language == "" or language.lower() == "en_us"): # Nothing to do as en_US will be chosen by default by the engine return else: print "" print _("Choose the language for SQL Server:") print (u"(1) English") print (u"(2) Deutsch") print (u"(3) Español") print (u"(4) Français") print (u"(5) Italiano") print (u"(6) 日本語") print (u"(7) ???") print (u"(8) Português") print (u"(9) Русский") print (u"(10) 中文 – 简体") languageOption = raw_input(_("Enter Option 1-11: ")) optionToLcid = { ‘1‘: ‘1033‘, #en-US ‘2‘: ‘1031‘, #de-DE ‘3‘: ‘3082‘, #es-ES ‘4‘: ‘1036‘, #fr-FR ‘5‘: ‘1040‘, #it-IT ‘6‘: ‘1041‘, #ja-JP ‘7‘: ‘1042‘, #ko-KR ‘8‘: ‘1046‘, #pt-BR ‘9‘: ‘1049‘, #ru-RU ‘10‘: ‘2052‘, #zh-CN ‘11‘: ‘1028‘} #zh-TW if (languageOption in optionToLcid.keys()): writeLcidToConfFile(optionToLcid[languageOption]) else: print _("Invalid Option. Exiting.") exit(errorExitCode)
修改后
if(noprompt == False): language = locale.getdefaultlocale()[0] if(language == None or language == "" or language.lower() == "en_us"): # Nothing to do as en_US will be chosen by default by the engine return else: print "" print _("Choose the language for SQL Server:") print (u"(1) English") print (u"(10) Chinese") languageOption = raw_input(_("Enter Option 1-11: ")) optionToLcid = { ‘1‘: ‘1033‘, #en-US ‘10‘: ‘2052‘} #zh-TW if (languageOption in optionToLcid.keys()): writeLcidToConfFile(optionToLcid[languageOption]) else: print _("Invalid Option. Exiting.") exit(errorExitCode)
### 再次执行配置
sudo /opt/mssql/bin/mssql-conf setup
一般成功了
### 更改 TCP 端口 为1430 并重启
sudo /opt/mssql/bin/mssql-conf set network.tcpport 1430 sudo systemctl restart mssql-server