[Email protected]C7 ~]# cat/etc/redhat-release #系统版本 CentOS Linux release 7.1.1503 (Core) [Email protected] ~]# firewall-cmd--state #查看firewall状态, close firewall Running [Email protected] ~]# systemctl stop firewalld.service #关闭 [Email protected] ~]# systemctl disable Firewalld.service #开机不启动 RM '/etc/systemd/system/dbus-org.fedoraproject.firewalld1.service ' RM '/etc/systemd/system/basic.target.wants/firewalld.service ' [Email protected] ~]# systemctl disable Firewalld.service #开机不启动 [Email protected] ~]# firewall-cmd--state #已关闭firewall Not running [[email protected] yum.repos.d]# pwd #进入/etc/yum.repos.d download two yum source files /etc/yum.repos.d [Email protected] yum.repos.d]# wget https://packages.microsoft.com/config/rhel/7/mssql-server.repo [Email protected] yum.repos.d]# wget https://packages.microsoft.com/config/rhel/7/prod.repo [email protected] yum.repos.d]# Yum search MSSQL #查看源信息, there are already package information 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) .... Slightly [Email protected] yum.repos.d]# yum install-y mssql-server mssql-tools #安装服务和工具 ... Slightly has been installed: Mssql-server.x86_64 0:14.0.1.246-6 has been installed: Mssql-tools.x86_64 0:14.0.1.246-1 [Email protected] ~]# cd/opt/mssql/bin/ #进入sql目录 [email protected] bin]# ls #下面有启动的文件 compress-dump.sh generate-core.sh mssql-conf sqlpackage sqlservr sqlservr-setup sqlservr-telemetry [[email protected] bin]# ./sqlservr-setup #执行此文件, follow the prompts to set the password and other information 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 on running it in unattended Mode.
Please enter a password for the system administrator (SA) account: Set Password Confirm the password for the system administrator (SA) account: Confirm password
Setting system Administrator (SA) account password ...
Does wish to start the SQL Server service now? [y/n]: Y Open service Do I wish to enable SQL Server to start on boot? [y/n]: Y boot start service 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. [[email protected] bin]# systemctl status MSSQL Mssql.service Loaded:not-found (reason:no such file or directory) Active:inactive (Dead)
[Email protected]C7 ~]# sqlcmd-s localhost-u SA Password: 1> select Db_name (); 2> Go --------------------------------------------------------------------------------------------------------------- ----------------- Master |