这里主要介绍如果安装mssql-cli工具用于管理,连接SQLServer,支持命令提示。
[root@sqlserver ~]# rpm --import https://packages.microsoft.com/keys/microsoft.asc
[root@sqlserver ~]# curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 193 100 193 0 0 329 0 --:--:-- --:--:-- --:--:-- 329
[packages-microsoft-com-prod]
name=packages-microsoft-com-prod
baseurl=https://packages.microsoft.com/rhel/7/prod/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
[root@sqlserver ~]# yum install mssql-cli -y
或者直接下载RPM包来安装,下载地址:
https://packages.microsoft.com/rhel/7/prod/mssql-cli-0.15.0-1.el7.x86_64.rpm
然后直接运行rpm -ivh命令来安装。
mssql-cli的Github地址:https://github.com/dbcli/mssql-cli
[root@sqlserver ~]# mssql-cli
Telemetry
---------
By default, mssql-cli collects usage data in order to improve your experience.
The data is anonymous and does not include commandline argument values.
The data is collected by Microsoft.
Disable telemetry collection by setting environment variable MSSQL_CLI_TELEMETRY_OPTOUT to 'True' or '1'.
Microsoft Privacy statement: https://privacy.microsoft.com/privacystatement
Username (press enter for sa):sa
Password:
Version: 0.15.0
Mail: sqlcli@microsoft.com
Home: http://github.com/dbcli/mssql-cli
master> select name from sys.databases
+--------+
| name |
|--------|
| master |
| tempdb |
| model |
| msdb |
+--------+
(4 rows affected)
Time: 0.353s
master>