一 关于sql server
sql server数据库是microsoft开发设计的一个关系数据库智能管理系统(rdbms)。
二 安装部署
2.1 安装依赖 python3
wget https://www.python.org/ftp/python/3.6.6/python-3.6.6.tar.xz tar -xvf python-3.6.6.tar.xz cd python-3.6.6 ./configure --prefix=/home/app/python-3.6.6 make && make install ln -s /home/app/python-3.6.6/bin/python3.6 /usr/bin/python3
2.2 安装mssql-server-2019
2.2.1 安装mssql-server
wget -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo yum install -y mssql-server
2.2.2 配置安装信息
在指定位置输入要安装的版本号和管理员账号sa的密码:
[root@test66 server2019]# /opt/mssql/bin/mssql-conf setup choose an edition of sql server: #仔细阅读每个版本的说明,选择适合自己的而版本,这里选择安装 3)express (free) 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=2109348&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): 3 ##输入上边自己要安装的版本对应的数字 the license terms for this product can be found in /usr/share/doc/mssql-server or downloaded from: https://go.microsoft.com/fwlink/?linkid=2104294&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: #输入管理员账号sa的密码,密码长度八位以上,且密码必须包含数字、字母和特殊字符 confirm the sql server system administrator password: #确认密码 configuring sql server... the licensing pid was successfully processed. the new edition is [express edition]. forceflush is enabled for this instance. forceflush feature is enabled for log durability. setup has completed successfully. sql server is now starting.
2.2.3 检查启动状态:
systemctl status mssql-server
查看启动端口
三 安装命令行工具
3.1 卸载服务器上老版本unixodbc-utf16-devel (如有)
yum remove unixodbc-utf16 unixodbc-utf16-devel
3.2 安装unixodbc-devel
wget -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
yum安装,两处交互信息都输入yes
[root@test66 tools]# yum install -y mssql-tools unixodbc-devel ....... #省略若干行 warning: rpmdb altered outside of yum. installing : unixodbc-2.3.7-1.rh.x86_64 1/4 the license terms for this product can be downloaded from https://aka.ms/odbc17eula and found in /usr/share/doc/msodbcsql17/license.txt . by entering 'yes', you indicate that you accept the license terms. do you accept the license terms? (enter yes or no) yes #输入yes installing : msodbcsql17-17.9.1.1-1.x86_64 2/4 the license terms for this product can be downloaded from http://go.microsoft.com/fwlink/?linkid=746949 and found in /usr/share/doc/mssql-tools/license.txt . by entering 'yes', you indicate that you accept the license terms. do you accept the license terms? (enter yes or no) yes #输入yes installing : mssql-tools-17.9.1.1-1.x86_64 3/4 installing : unixodbc-devel-2.3.7-1.rh.x86_64 4/4 verifying : unixodbc-2.3.7-1.rh.x86_64 1/4 verifying : unixodbc-devel-2.3.7-1.rh.x86_64 2/4 verifying : msodbcsql17-17.9.1.1-1.x86_64 3/4 verifying : mssql-tools-17.9.1.1-1.x86_64 4/4 installed: mssql-tools.x86_64 0:17.9.1.1-1 unixodbc-devel.x86_64 0:2.3.7-1.rh dependency installed: msodbcsql17.x86_64 0:17.9.1.1-1 unixodbc.x86_64 0:2.3.7-1.rh
3.3 设置环境变量
echo "export path=$path:/opt/mssql-tools/bin" >> /etc/profile source /etc/profile
四 验证数据库
4.1 登录数据库
[root@test66 tools]# sqlcmd -s localhost -u sa -p password: 1>
4.2 创建测试库
1> create database [sre] 2> go
4.3 查看所有database
1> select [name] from sys.databases 2> go
4.4 删除数据库
1> drop database sre 2> go
到此这篇关于centos7部署sqlserver2019的实现步骤的文章就介绍到这了,更多相关centos7部署sqlserver2019内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!
发表评论