关闭

Linux下安装SQL Server 2016(安装篇SQL Server on linux)

标签: LinuxSQL SERVERsql server on linux
8390人阅读 评论(13) 收藏 举报
分类:

准备篇:Linux下安装SQL Server 2016(准备篇)

安装篇:Linux下安装SQL Server 2016(安装篇)

连接篇:Linux下安装SQL Server 2016(连接篇)


安装过程


如何安装直接参考这个文章:安装sql server

整个安装过程非常简单生气

上面的文档里是通过 sudo 命令,用root身份来执行,不过这里为了简单,就用root账号来安装的。

(1)下载sql server的源,便于通过yum命令来安装

curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo

[root@localhost Desktop]# curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   220  100   220    0     0    117      0  0:00:01  0:00:01 --:--:--   117

(2)安装

yum install -y mssql-server

[root@localhost Desktop]# yum install -y mssql-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package mssql-server.x86_64 0:14.0.1.246-6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package       Arch    Version       Repository                            Size
================================================================================
Installing:
 mssql-server  x86_64  14.0.1.246-6  packages-microsoft-com-mssql-server  138 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 138 M
Installed size: 138 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/packages-microsoft-com-mssql-server/packages/mssql-server-14.0.1.246-6.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID be1229cf: NOKEY
Public key for mssql-server-14.0.1.246-6.x86_64.rpm is not installed
mssql-server-14.0.1.246-6.x86_64.rpm                       | 138 MB   14:11     
Retrieving key from https://packages.microsoft.com/keys/microsoft.asc
Importing GPG key 0xBE1229CF:
 Userid     : "Microsoft (Release signing) <gpgsecurity@microsoft.com>"
 Fingerprint: bc52 8686 b50d 79e3 39d3 721c eb3e 94ad be12 29cf
 From       : https://packages.microsoft.com/keys/microsoft.asc
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mssql-server-14.0.1.246-6.x86_64                             1/1 

+-------------------------------------------------------------------+
| Please run /opt/mssql/bin/sqlservr-setup to complete the setup of |
|                  Microsoft(R) SQL Server(R).                      |
+-------------------------------------------------------------------+

  Verifying  : mssql-server-14.0.1.246-6.x86_64                             1/1 

Installed:
  mssql-server.x86_64 0:14.0.1.246-6                                            

Complete!
[root@localhost Desktop]# 

(3)配置

/opt/mssql/bin/sqlservr-setup
这个主要是设置sql server的系统管理员sa的密码,要求密码最少8个字符、数字、非字母数字符号等。

另外,还要求内存至少3250M,少一点就报错可怜。。。

最后会问是否要启动sql server服务,是否要在系统启动时启动sql server,输入y就可以了。

[root@localhost Desktop]# /opt/mssql/bin/sqlservr-setup
Microsoft(R) SQL Server(R) Setup

You can abort setup at anytime by pressing Ctrl-C. Start this program
with the --help option for information about running it in unattended
mode.

Please enter a password for the system administrator (SA) account: 
Please confirm the password for the system administrator (SA) account: 

Setting system administrator (SA) account password...

Do you wish to start the SQL Server service now? [y/n]: y
Do you wish to enable SQL Server to start on boot? [y/n]: y
Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server.service to /usr/lib/systemd/system/mssql-server.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server-telemetry.service to /usr/lib/systemd/system/mssql-server-telemetry.service.

Setup completed successfully.

(4)看一下sql server的状态

这里先把状态写入s.txt文件,然后查看s.txt文件。

会发现有好几个进程。

[root@localhost Desktop]# systemctl status mssql-server > s.txt
[root@localhost Desktop]# cat s.txt
● mssql-server.service - Microsoft(R) SQL Server(R) Database Engine
   Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2016-12-01 15:09:51 CST; 31min ago
 Main PID: 4963 (sqlservr)
   CGroup: /system.slice/mssql-server.service
           ├─4963 /opt/mssql/bin/sqlservr
           └─4971 /opt/mssql/bin/sqlservr

Dec 01 15:09:58 localhost.localdomain systemd[1]: [/usr/lib/systemd/system/mssql-server.service:15] Unknown lvalue 'TasksMax' in section 'Service'
Dec 01 15:09:58 localhost.localdomain sqlservr[4963]: 2016-12-01 07:09:58.39 spid20s     The Service Broker endpoint is in disabled or stopped state.
Dec 01 15:09:58 localhost.localdomain sqlservr[4963]: 2016-12-01 07:09:58.39 spid20s     The Database Mirroring endpoint is in disabled or stopped state.
Dec 01 15:09:58 localhost.localdomain sqlservr[4963]: 2016-12-01 07:09:58.45 spid20s     Service Broker manager has started.
Dec 01 15:09:58 localhost.localdomain sqlservr[4963]: 2016-12-01 07:09:58.51 spid5s      Recovery is complete. This is an informational message only. No user action is required.
Dec 01 15:10:00 localhost.localdomain sqlservr[4963]: 2016-12-01 07:10:00.34 spid30s     The activated proc '[dbo].[sp_syspolicy_events_reader]' running on queue 'msdb.dbo.syspolicy_event_queue' output the following:  'Transaction (Process ID 30) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.'
Dec 01 15:15:02 localhost.localdomain sqlservr[4963]: 2016-12-01 07:15:02.11 spid51      Using 'dbghelp.dll' version '4.0.5'
Dec 01 15:15:08 localhost.localdomain sqlservr[4963]: 2016-12-01 07:15:08.27 spid51      Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
Dec 01 15:15:08 localhost.localdomain sqlservr[4963]: 2016-12-01 07:15:08.32 spid51      Using 'xplog70.dll' version '2016.140.01' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
Dec 01 15:33:36 localhost.localdomain sqlservr[4963]: 2016-12-01 07:31:59.09 spid3s      Warning: Failure to calculate super-latch promotion threshold.

至此,sql server安装完成大笑

1
0
查看评论

如何在Linux上安装和使用MS SQL Server

今年早些时候,微软宣布他们的将MS SQL Server运行在Linux上的计划震惊了IT界。在Satya Nadella的领导下,微软这个雷德蒙德的巨头在Linux主导的产业(如快速推动云的技术)方面取得了显著进展。使SQL Server可以在Linux环境下运行,是这种进程的另一个标志性的举动。
  • cdshrewd
  • cdshrewd
  • 2016-11-28 23:16
  • 6187

Linux(CentOS)环境下安装SQL SERVER

一、准备工作1、首先安装CentOS系统版本下载地址1下载地址2可在以上网址查最新版本2、本机需要连接互联网(后面实例是以在线安装为例),在线安装便洁,也会提到离线安装直接下载安装包.二、安装SQL SERVER(以root用户账号安装)1、下载Microsoft Red Hat存储库配置文件。[r...
  • roy_88
  • roy_88
  • 2017-01-18 16:42
  • 10023

yum源导入KEY值----warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

yum源更新后需要导入 key值,否则报错如下,无法安装相关的包。  Total size: 42 M Downloading Packages: warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c10...
  • wulantian
  • wulantian
  • 2014-03-10 12:35
  • 23869

Linux下安装SQL Server 2016(准备篇SQL Server on linux)

下载centos 7.2 : http://www.centoscn.com/CentosSoft/iso/2016/0601/7341.html
  • yupeigu
  • yupeigu
  • 2016-12-01 15:17
  • 9928

Microsoft SQL Server for Linux安装和配置

虽说mssql for linux早已经出来了,但原本没有打算这么早就去尝试的,无奈之下还是得先尝试用了,这里分几篇介绍我在用mssql for linux时遇到的问题,不得不说作为先吃螃蟹的人总是要付出一些代价的,真是会遇到各种奇葩问题,本篇博客只介绍如何安装mssql for linux,我依旧...
  • u010584641
  • u010584641
  • 2017-06-04 15:38
  • 1108

MySQL for Linux安装配置

1、下载MySQL的Linux安装文件  Linux下安装MySQL需要下面两个文件:   MySQL-server-5.1.7-0.i386.rpm  下载地址为:http://dev.mysql.com/downloads/mysql/5.1.html,打开此网页,下拉网页找到“Lin...
  • cxy1238
  • cxy1238
  • 2008-06-06 23:09
  • 7646

linux 中mysql 四种启动方式

mysql的四种启动方式: 1、mysqld 启动mysql服务器:./mysqld --defaults-file=/etc/my.cnf --user=root 客户端连接: mysql --defaults-file=/etc/my.cnf or mysql...
  • Hu_wen
  • Hu_wen
  • 2017-06-15 00:31
  • 2088

SQL SERVER ON LINUX安装和使用

其实到微软出这个linux版比较尴尬,如果能早些时候出来的话,肯定是挺好的。不过有总比没有好。今天主要讲SQL SERVER ON LINUX 如何安装 和基本使用
  • z10843087
  • z10843087
  • 2017-09-27 09:32
  • 806

KaliLinux安装SqlServer数据库

官方给出了ubuntu、redhut、suse的安装方式,想想kali和ubuntu都是基于debian的linux,也是可以安装的。
  • jimo_lonely
  • jimo_lonely
  • 2017-03-09 14:37
  • 972

SQL Server 2017 on Linux自动安装

SQL Server 2017在Linux平台安装虽然很简单,只要按照指令一行一行贴上就可以完成,但懒人总是想着更快的方法,于是找了官方文件发现竟然有自动安装的范例,测试一下果真OK。请参阅以Red Hat Enterprise Linux为例,利用vi指令在Linux内建一个档案例如install...
  • daan5com
  • daan5com
  • 2017-10-12 19:08
  • 598
    个人资料
    • 访问:526308次
    • 积分:9035
    • 等级:
    • 排名:第2474名
    • 原创:362篇
    • 转载:14篇
    • 译文:1篇
    • 评论:137条
    博客专栏
    最新评论