> php教程 > PHP开发 > 본문

리눅스에 SQL Server 설치

高洛峰
풀어 주다: 2016-12-02 16:03:51
원래의
1283명이 탐색했습니다.

Centos 7 시스템을 예로 들어 보겠습니다.

[root@c7 ~]# cat /etc/redhat-release              #系统版本
CentOS Linux release 7.1.1503 (Core) 
[root@c7 ~]# firewall-cmd --state                 #查看firewall状态,关闭firewall
running
[root@c7 ~]# systemctl stop firewalld.service     #关闭
[root@c7 ~]# systemctl disable firewalld.service  #开机不启动
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@c7 ~]# systemctl disable firewalld.service  #开机不启动
[root@c7 ~]# firewall-cmd --state                 #已关闭firewall
not running
[root@c7 yum.repos.d]# pwd                        #进入/etc/yum.repos.d下载二个yum源文件
/etc/yum.repos.d
[root@c7 yum.repos.d]# wget https://packages.microsoft.com/config/rhel/7/mssql-server.repo
[root@c7 yum.repos.d]# wget https://packages.microsoft.com/config/rhel/7/prod.repo
[root@c7 yum.repos.d]# yum search mssql           #查看源信息,已有包信息
mssql-server.x86_64 : Microsoft(R) SQL Server(R) Relational Database Engine
mssql-server-ha.x86_64 : Microsoft(R) SQL Server(R) Relational Database Engine
mssql-tools.x86_64 : Tools for Microsoft(R) SQL Server (R)
....略
[root@c7 yum.repos.d]# yum install -y mssql-server mssql-tools    #安装服务和工具
...略
已安装:
  mssql-server.x86_64 0:14.0.1.246-6
已安装:
  mssql-tools.x86_64 0:14.0.1.246-1 
[root@c7 ~]# cd /opt/mssql/bin/                   #进入sql目录
[root@c7 bin]# ls                                 #下面有启动的文件
compress-dump.sh  generate-core.sh  mssql-conf  sqlpackage  sqlservr  sqlservr-setup  sqlservr-telemetry
[root@c7 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                 开机启动服务
ln -s '/usr/lib/systemd/system/mssql-server.service' '/etc/systemd/system/multi-user.target.wants/mssql-server.service'
ln -s '/usr/lib/systemd/system/mssql-server-telemetry.service' '/etc/systemd/system/multi-user.target.wants/mssql-server-telemetry.service'

Setup completed successfully.
[root@c7 bin]# systemctl status mssql
mssql.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

[root@c7 ~]# sqlcmd -S localhost -U sa
Password: 
1> select db_name();
2> go
                                                                                                                                
--------------------------------------------------------------------------------------------------------------------------------
master
로그인 후 복사

CPU와 메모리를 많이 사용하는 프로세스 보기

# ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
로그인 후 복사

리눅스에 SQL Server 설치

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!