Installing mssql-cli

mssql-cli is an interactive command-line tool for querying SQL Server, install it on Windows, macOS, or Linux.

To download mssqli-cli package , download and install python on the OS. The latest Python installation package can be downloaded from here

Once Python is installed successfully, open command prompt with elevated permissions and run the below command

pip install mssql-cli

For detailed installation instructions, see the Installation Guide.

C:\>curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1603k  100 1603k    0     0  1603k      0  0:00:01 --:--:--  0:00:01 3306k

C:\>pip install mssql-cli
Collecting mssql-cli
  Downloading https://files.pythonhosted.org/packages/52/e5/062c59bb6875d3891d5cc8d1b22fb763a6735c8d49dcc390a5b130fff31c/mssql_cli-0.13.0-py2.py3-none-win32.whl (33.6MB)
    100% |████████████████████████████████| 33.6MB 7.7kB/s
Collecting future>=0.16.0 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz (824kB)
    100% |████████████████████████████████| 829kB 314kB/s
Collecting click>=4.1 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
    100% |████████████████████████████████| 71kB 1.1MB/s
Collecting enum34>=1.1.6 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/af/42/cb9355df32c69b553e72a2e28daee25d1611d2c0d9c272aa1d34204205b2/enum34-1.1.6-py3-none-any.whl
Collecting prompt-toolkit<1.1.0,>=1.0.10 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/04/d1/c6616dd03701e7e2073f06d5c3b41b012256e42b72561f16a7bd86dd7b43/prompt_toolkit-1.0.15-py3-none-any.whl (247kB)
    100% |████████████████████████████████| 256kB 968kB/s
Collecting argparse>=1.2.1 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl
Collecting wheel>=0.29.0 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB)
    100% |████████████████████████████████| 51kB 1.0MB/s
Collecting sqlparse<0.3.0,>=0.2.2 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/65/85/20bdd72f4537cf2c4d5d005368d502b2f464ede22982e724a82c86268eda/sqlparse-0.2.4-py2.py3-none-any.whl
Collecting humanize>=0.5.1 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/8c/e0/e512e4ac6d091fc990bbe13f9e0378f34cf6eecd1c6c268c9e598dcf5bb9/humanize-0.5.1.tar.gz
Collecting applicationinsights>=0.11.1 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/93/fc/d58638b3697c6e5cb87f5e79e9ccdcb1c7a89e6feb5954613d90a71e7c94/applicationinsights-0.11.4-py2.py3-none-any.whl (53kB)
    100% |████████████████████████████████| 61kB 1.2MB/s
Collecting Pygments>=2.0 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl (841kB)
    100% |████████████████████████████████| 849kB 144kB/s
Collecting cli-helpers<1.0.0,>=0.2.3 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/47/cb/f48ef4a7de944b64e0b55f76914901cc8b4aa8b68afe1fc0fe50ffe21f7c/cli_helpers-0.2.3-py2.py3-none-any.whl
Collecting configobj>=5.0.6 (from mssql-cli)
  Downloading https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz
Collecting wcwidth (from prompt-toolkit<1.1.0,>=1.0.10->mssql-cli)
  Downloading https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl
Collecting six>=1.9.0 (from prompt-toolkit<1.1.0,>=1.0.10->mssql-cli)
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting backports.csv>=1.0.0 (from cli-helpers<1.0.0,>=0.2.3->mssql-cli)
  Downloading https://files.pythonhosted.org/packages/71/f7/5db9136de67021a6dce4eefbe50d46aa043e59ebb11c83d4ecfeb47b686e/backports.csv-1.0.6-py2.py3-none-any.whl
Collecting terminaltables>=3.0.0 (from cli-helpers<1.0.0,>=0.2.3->mssql-cli)
  Downloading https://files.pythonhosted.org/packages/9b/c4/4a21174f32f8a7e1104798c445dacdc1d4df86f2f26722767034e4de4bff/terminaltables-3.1.0.tar.gz
Installing collected packages: future, click, enum34, wcwidth, six, prompt-toolkit, argparse, wheel, sqlparse, humanize, applicationinsights, Pygments, backports.csv, terminaltables, cli-helpers, configobj, mssql-cli
  Running setup.py install for future ... done
  Running setup.py install for humanize ... done
  Running setup.py install for terminaltables ... done
  Running setup.py install for configobj ... done
Successfully installed Pygments-2.2.0 applicationinsights-0.11.4 argparse-1.4.0 backports.csv-1.0.6 cli-helpers-0.2.3 click-6.7 configobj-5.0.6 enum34-1.1.6 future-0.16.0 humanize-0.5.1 mssql-cli-0.13.0 prompt-toolkit-1.0.15 six-1.11.0 sqlparse-0.2.4 terminaltables-3.1.0 wcwidth-0.1.7 wheel-0.31.1
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Usage Guide is available on git hub.

 

Leave a Reply

Your email address will not be published. Required fields are marked *