Centos8.1+sqlserver2019的快速离线安装
系统环境:Centos8.1
数据库版本要求:sqlserver2019
官方安装参考:https://docs.microsoft.com/zh-cn/sql/linux/sql-server-linux-setup?view=sql-server-ver15
介质准备:
1. libatomic-8.5.0-4.el8_5.x86_64.rpm
2. mssql-server-15.0.4236.7-1.x86_64.rpm
3. unixODBC-2.3.7-1.rh.x86_64.rpm
4. msodbcsql17-17.10.1.1-1.x86_64.rpm
5. mssql-tools-17.10.1.1-1.x86_64.rpm
介质下载地址:
https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/libatomic-8.5.0-4.el8_5.x86_64.rpm
https://packages.microsoft.com/rhel/8/prod/
https://packages.microsoft.com/rhel/8/mssql-server-2019/
安装命令:rpm -ivh libatomic-8.5.0-4.el8_5.x86_64.rpm按照上述1-5顺序安装即可。
如可联网,直接yum localinstall mssql-server-15.0.4236.7-1.x86_64.rpm方便。
配置环境变量:/etc/profile添加export PATH=$PATH:/opt/mssql-tools/bin
source /etc/profile生效
设置默认数据库路径:
chown -R mssql:mssql /xxx/xxx
/opt/mssql/bin/mssql-conf set filelocation.defaultdatadir /xxx/xxx/sqldata
启用代理服务:
/opt/mssql/bin/mssql-conf set sqlagent.enabled true
更换license:
systemctl stop mssql-server
/opt/mssql/bin/mssql-conf setup
查看数据库日志:
tail -f /var/opt/mssql/log/errorlog
连接数据库:
sqlcmd -S localhost -U sa -P xxx
Password:
1> select @@version
2> go
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft SQL Server 2019 (RTM-CU16-GDR) (KB5014353) - 15..4236.7 (X64)
May 29 2022 15:55:47
Copyright (C) 2019 Microsoft Corporation
Enterprise Evaluation Edition (64-bit) on Linux (Red Hat Enterprise Linux 8.1 (Ootpa)) <X64>
1> select name from sysdatabases
2> go
name
--------------------------------------------------------------------------------------------------------------------------------
master
tempdb
model
msdb
pkgid
关闭防火墙:
systemctl disable firewalld
systemctl stop firewalld
在windows客户端安装smss,方便管理创建数据库,建用户等操作。
下载地址:https://docs.microsoft.com/zh-cn/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver16
kettle等工具连接可能遇到报错,需下载指定jdbc的jdk版本:mssql-jdbc-8.2.2.jre8.jar
其它参考:
各版本对比:
https://docs.microsoft.com/zh-cn/sql/sql-server/editions-and-components-of-sql-server-2019?view=sql-server-ver15
本文来源https://www.modb.pro/db/445811
相关文章