centos 7.7 下安装 sql server 2019

本文详细介绍了在CentOS7.7系统中安装SQLServer2019的过程,包括下载Microsoft存储库配置文件、通过yum安装SQLServer、配置软件版本及许可条款接受、设置管理员密码、修改默认端口等关键步骤,同时提供了注意事项确保安装顺利。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

centos 7.7 下安装 sql server 2019

# 下载 Microsoft SQL Server Red Hat 存储库配置文件
[root@192 ~]# sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   231  100   231    0     0    662      0 --:--:-- --:--:-- --:--:--   663
 
 
# 通过yum 安装 SQL Server
[root@192 lnmp1.6]# yum install -y mssql-server
 
# 配置 Microsoft SQL Server
[root@192 ~]# sudo /opt/mssql/bin/mssql-conf setup
usermod: no changes
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) - CPU Core utilization restricted to 20 physical/40 hyperthreaded
  7) Enterprise Core (PAID) - CPU Core utilization up to Operating System Maximum
  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
 
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
 
Do you accept the license terms? [Yes/No]:Yes
 
Enter the SQL Server system administrator password: 
Confirm the SQL Server system administrator password: 
Configuring SQL Server...
 
 
# 查看是否安装成功
[root@192 ~]# systemctl status mssql-server

# 修改默认端口 
sudo /opt/mssql/bin/mssql-conf set network tcpport 5555

# 查看可用配置项
sudo /opt/mssql/bin/mssql-conf list

解决乱码问题

创建数据库时要加参数
“create database " + dbName + " COLLATE Chinese_PRC_CI_AS;”;

或者在SQL SERVER MANAGEMENT STUDIO中可视化创建时指定排序规则为Chinese_PRC_CI_AS
在这里插入图片描述

注意事项

1.内存必须大于2G.
2.选择Express版本对于小规模应用足够,它的限制是:数据库文件大小限制是10G,CPU限制4核以下

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值