SQL Server on Linux的安装(3)

[root@linuxidcserver ~]# wget https://packages.microsoft.com/config/rhel/7/prod.repo
--2016-11-17 19:59:49-- https://packages.microsoft.com/config/rhel/7/prod.repo
Resolving packages.microsoft.com (packages.microsoft.com)... 13.75.127.55
Connecting to packages.microsoft.com (packages.microsoft.com)|13.75.127.55|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 193 [application/octet-stream]
Saving to: 'prod.repo'
 
100%[=================================================================================================================>] 193 --.-K/s in 0s
 
2016-11-17 19:59:50 (30.2 MB/s) - 'prod.repo' saved [193/193]
 
[root@linuxidcserver ~]# mv prod.repo /etc/yum.repos.d/
[root@linuxidcserver ~]# yum makecache
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
openlogic | 1.3 kB 00:00:00
packages-microsoft-com-mssql-server | 2.9 kB 00:00:00
packages-microsoft-com-prod | 2.9 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/3): packages-microsoft-com-prod/filelists_db | 2.7 kB 00:00:00
(2/3): packages-microsoft-com-prod/other_db | 10 kB 00:00:00
(3/3): packages-microsoft-com-prod/primary_db | 4.6 kB 00:00:00
Loading mirror speeds from cached hostfile
Metadata Cache Created

安装:

[root@linuxidcserver ~]# yum install mssql-tools
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mssql-tools.x86_64 0:14.0.1.246-1 will be installed
--> Processing Dependency: msodbcsql for package: mssql-tools-14.0.1.246-1.x86_64
--> Running transaction check
---> Package msodbcsql.x86_64 0:13.0.1.0-1 will be installed
--> Processing Dependency: unixODBC-utf16 for package: msodbcsql-13.0.1.0-1.x86_64
--> Processing Dependency: libodbcinst.so.2()(64bit) for package: msodbcsql-13.0.1.0-1.x86_64
--> Running transaction check
---> Package unixODBC-utf16.x86_64 0:2.3.1-1 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-utf16-2.3.1-1.x86_64
--> Running transaction check
---> Package libtool-ltdl.x86_64 0:2.4.2-21.el7_2 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Installing:
mssql-tools x86_64 14.0.1.246-1 packages-microsoft-com-prod 249 k
Installing for dependencies:
libtool-ltdl x86_64 2.4.2-21.el7_2 updates 49 k
msodbcsql x86_64 13.0.1.0-1 packages-microsoft-com-prod 3.8 M
unixODBC-utf16 x86_64 2.3.1-1 packages-microsoft-com-prod 329 k
 
Transaction Summary
===========================================================================================================================================================
Install 1 Package (+3 Dependent packages)
 
Total download size: 4.5 M
Installed size: 4.5 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): libtool-ltdl-2.4.2-21.el7_2.x86_64.rpm | 49 kB 00:00:00
(2/4): msodbcsql-13.0.1.0-1.x86_64.rpm | 3.8 MB 00:00:00
(3/4): mssql-tools-14.0.1.246-1.x86_64.rpm | 249 kB 00:00:00
(4/4): unixODBC-utf16-2.3.1-1.x86_64.rpm | 329 kB 00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Total 8.3 MB/s | 4.5 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libtool-ltdl-2.4.2-21.el7_2.x86_64 1/4
Installing : unixODBC-utf16-2.3.1-1.x86_64 2/4
The license terms for this product can be downloaded from
?LinkId=746838 and found in
/usr/share/doc/msodbcsql/LICENSE.TXT . By entering 'YES',
you indicate that you accept the license terms.
 
Do you accept the license terms? (Enter YES or NO)
YES
Installing : msodbcsql-13.0.1.0-1.x86_64 3/4
The license terms for this product can be downloaded from
?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
Installing : mssql-tools-14.0.1.246-1.x86_64 4/4
Verifying : libtool-ltdl-2.4.2-21.el7_2.x86_64 1/4
Verifying : msodbcsql-13.0.1.0-1.x86_64 2/4
Verifying : unixODBC-utf16-2.3.1-1.x86_64 3/4
Verifying : mssql-tools-14.0.1.246-1.x86_64 4/4
 
Installed:
mssql-tools.x86_64 0:14.0.1.246-1
 
Dependency Installed:
libtool-ltdl.x86_64 0:2.4.2-21.el7_2 msodbcsql.x86_64 0:13.0.1.0-1 unixODBC-utf16.x86_64 0:2.3.1-1
 
Complete!

安装成功!

测试连接:

[root@linuxidcserver ~]# sqlcmd -S localhost -U SA
Password:

登陆成功。

创建数据库test:

1> create database test;
2> go
1> use test;
2> go
Changed database context to 'test'.

查看数据库:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/1d1b9921e43335f3c729a21eeb76de78.html