Microsoft Sql Server 2016安装在CentOS7下

安装过程

 

如何安装直接参考这个文章:安装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

 

 

[plain]  view plain  copy
 
 在CODE上查看代码片派生到我的代码片
  1. [root@localhost Desktop]# curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo  
  2.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current  
  3.                                  Dload  Upload   Total   Spent    Left  Speed  
  4. 100   220  100   220    0     0    117      0  0:00:01  0:00:01 --:--:--   117  

 

(2)安装

yum install -y mssql-server

 

 

[plain]  view plain  copy
 
 在CODE上查看代码片派生到我的代码片
  1. [root@localhost Desktop]# yum install -y mssql-server  
  2. Loaded plugins: fastestmirror, langpacks  
  3. Loading mirror speeds from cached hostfile  
  4.  * base: mirrors.aliyun.com  
  5.  * extras: mirrors.aliyun.com  
  6.  * updates: mirrors.163.com  
  7. Resolving Dependencies  
  8. --> Running transaction check  
  9. ---> Package mssql-server.x86_64 0:14.0.1.246-6 will be installed  
  10. --> Finished Dependency Resolution  
  11.   
  12. Dependencies Resolved  
  13.   
  14. ================================================================================  
  15.  Package       Arch    Version       Repository                            Size  
  16. ================================================================================  
  17. Installing:  
  18.  mssql-server  x86_64  14.0.1.246-6  packages-microsoft-com-mssql-server  138 M  
  19.   
  20. Transaction Summary  
  21. ================================================================================  
  22. Install  1 Package  
  23.   
  24. Total download size: 138 M  
  25. Installed size: 138 M  
  26. Downloading packages:  
  27. 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  
  28. Public key for mssql-server-14.0.1.246-6.x86_64.rpm is not installed  
  29. mssql-server-14.0.1.246-6.x86_64.rpm                       | 138 MB   14:11       
  30. Retrieving key from https://packages.microsoft.com/keys/microsoft.asc  
  31. Importing GPG key 0xBE1229CF:  
  32.  Userid     : "Microsoft (Release signing) <gpgsecurity@microsoft.com>"  
  33.  Fingerprint: bc52 8686 b50d 79e3 39d3 721c eb3e 94ad be12 29cf  
  34.  From       : https://packages.microsoft.com/keys/microsoft.asc  
  35. Running transaction check  
  36. Running transaction test  
  37. Transaction test succeeded  
  38. Running transaction  
  39.   Installing : mssql-server-14.0.1.246-6.x86_64                             1/1   
  40.   
  41. +-------------------------------------------------------------------+  
  42. | Please run /opt/mssql/bin/sqlservr-setup to complete the setup of |  
  43. |                  Microsoft(R) SQL Server(R).                      |  
  44. +-------------------------------------------------------------------+  
  45.   
  46.   Verifying  : mssql-server-14.0.1.246-6.x86_64                             1/1   
  47.   
  48. Installed:  
  49.   mssql-server.x86_64 0:14.0.1.246-6                                              
  50.   
  51. Complete!  
  52. [root@localhost Desktop]#   

 

(3)配置

 

/opt/mssql/bin/sqlservr-setup

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

 

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

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

 

[plain]  view plain  copy
 
 在CODE上查看代码片派生到我的代码片
  1. [root@localhost Desktop]# /opt/mssql/bin/sqlservr-setup  
  2. Microsoft(R) SQL Server(R) Setup  
  3.   
  4. You can abort setup at anytime by pressing Ctrl-C. Start this program  
  5. with the --help option for information about running it in unattended  
  6. mode.  
  7.   
  8. Please enter a password for the system administrator (SA) account:   
  9. Please confirm the password for the system administrator (SA) account:   
  10.   
  11. Setting system administrator (SA) account password...  
  12.   
  13. Do you wish to start the SQL Server service now? [y/n]: y  
  14. Do you wish to enable SQL Server to start on boot? [y/n]: y  
  15. Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server.service to /usr/lib/systemd/system/mssql-server.service.  
  16. Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server-telemetry.service to /usr/lib/systemd/system/mssql-server-telemetry.service.  
  17.   
  18. Setup completed successfully.  


(4)看一下sql server的状态

 

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

会发现有好几个进程。

 

[plain]  view plain  copy
 
 在CODE上查看代码片派生到我的代码片
  1. [root@localhost Desktop]# systemctl status mssql-server > s.txt  
  2. [root@localhost Desktop]# cat s.txt  
  3. ● mssql-server.service - Microsoft(R) SQL Server(R) Database Engine  
  4.    Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendor preset: disabled)  
  5.    Active: active (running) since Thu 2016-12-01 15:09:51 CST; 31min ago  
  6.  Main PID: 4963 (sqlservr)  
  7.    CGroup: /system.slice/mssql-server.service  
  8.            ├─4963 /opt/mssql/bin/sqlservr  
  9.            └─4971 /opt/mssql/bin/sqlservr  
  10.   
  11. Dec 01 15:09:58 localhost.localdomain systemd[1]: [/usr/lib/systemd/system/mssql-server.service:15] Unknown lvalue 'TasksMax' in section 'Service'  
  12. 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.  
  13. 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.  
  14. Dec 01 15:09:58 localhost.localdomain sqlservr[4963]: 2016-12-01 07:09:58.45 spid20s     Service Broker manager has started.  
  15. 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.  
  16. 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.'  
  17. Dec 01 15:15:02 localhost.localdomain sqlservr[4963]: 2016-12-01 07:15:02.11 spid51      Using 'dbghelp.dll' version '4.0.5'  
  18. 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.  
  19. 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.  
  20. 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安装完成

转载于:https://www.cnblogs.com/littlewrong/p/6350076.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值