Linux安装SQL Server报错
一、现象
[root@server01 ~]# /opt/mssql/bin/mssql-conf setup
Choose an edition of SQL Server:
1) Evaluation (free, no production use rights, 180-day limit)
2) Developer (free, no production use rights)
3) Express (free)
4) Web (PAID)
5) Standard (PAID)
6) Enterprise (PAID)
7) Enterprise Core (PAID)
8) I bought a license through a retail sales channel and have a product key to enter.
Details about editions can be found at
https://go.microsoft.com/fwlink/?LinkId=852748&clcid=0x409
Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.
Enter your edition(1-8): 2
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:
https://go.microsoft.com/fwlink/?LinkId=855862&clcid=0x409
The privacy statement can be viewed at:
https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
The passwords do not match. Please try again.
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
The passwords do not match. Please try again.
Enter the SQL Server system administrator password:
The specified password contains an invalid character. Valid characters include uppercase letters, lowercase letters, numbers, symbols, punctuation marks, and unicode characters that are categorized as alphabetic but are not uppercase or lowercase.
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
/opt/mssql/bin/sqlservr: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by /opt/mssql/bin/sqlservr)
/opt/mssql/bin/sqlservr: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /opt/mssql/bin/../lib/libc++abi.so.1)
Initial setup of Microsoft SQL Server failed. Please consult the ERRORLOG
in /var/opt/mssql/log for more information.
二、原因
根本原因是官方的存储库路径是/rhel/8/,而当前使用的系统是Centos7.9,下载路径没有更改过来,重新下载即可:
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2017.repo
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
[root@server01 ~]# more /etc/yum.repos.d/mssql-server.repo
[packages-microsoft-com-mssql-server-2017]
name=packages-microsoft-com-mssql-server-2017
baseurl=https://packages.microsoft.com/rhel/7/mssql-server-2017/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
三、解决方法
(1)卸载sql server
[root@server01 ~]# rpm -qa |grep mssql
mssql-server-14.0.3436.1-1.x86_64
[root@server01 ~]# rpm -e mssql-server-14.0.3436.1-1.x86_64
(2)删除旧的存储库
[root@server01 ~]# ls -l /etc/yum.repos.d
[root@server01 ~]# rm -rf /etc/yum.repos.d/mssql-server.repo
(3)下载新的存储库
[root@server01 ~]# curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
(4)更新YUM
[root@server01 ~]# yum clean all
(5)重新安装sql server
[root@server01 ~]# yum install -y mssql-server
四、官方存储库路径
存储库 |
版本 |
Command |
2019 CU |
2019 |
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo |
2019 GDR |
2019 |
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019-gdr.repo |
2017 CU |
2017 |
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2017.repo |
2017 GDR |
2017 |
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017-gdr.repo |