Skip to main content

Unable to connect to Vertica using Powershell

  • September 26, 2017
  • 4 replies
  • 18 views

Slaagh
Forum|alt.badge.img+1
  • Participating Frequently

Hello,

I have been trying to connect to Vertica using Powershell as the client.When I plug in the command below Powershell just hangs, as if its processing something but never completes. I have tried this in CMD prompt and it works fine.

Has anyone experienced this issue before?

PS C:\Users> vsql -h 010.010.1.010 -d MY_DATABASE

4 replies

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • September 27, 2017

Hi,

Works for me in PS (Windows 7):

PS C:\Program Files\Vertica Systems\VSQL64> .\vsql -h verticademos.com
Welcome to vsql, the Vertica Analytic Database interactive terminal.

Type:  \h or \? for help with vsql commands
       \g or terminate with semicolon to execute query
       \q to quit

Warning: Console code page (437) differs from Windows code page (1252)
         8-bit characters may not work correctly. See vsql reference
         page "Notes for Windows users" for details.

dbadmin=> select 'Vertica is Awesome!' "FACT";
        FACT
---------------------
 Vertica is Awesome!
(1 row)

For the server IP address, why are you using "010.010.1.010" instead of "10.10.1.10"?

Note you can get rid of the console code page warning message by changing the code page...

PS C:\Program Files\Vertica Systems\VSQL64> chcp 1252
Active code page: 1252

PS C:\Program Files\Vertica Systems\VSQL64> .\vsql -h verticademos.com
Welcome to vsql, the Vertica Analytic Database interactive terminal.

Type:  \h or \? for help with vsql commands
       \g or terminate with semicolon to execute query
       \q to quit

dbadmin=>

Slaagh
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • September 27, 2017

That IP address is just a random number. I cannot imagine anyone who would use that convention.


Slaagh
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • September 27, 2017

I am able to access Vertica using TOAD data tools and CMD Prompt. Do you have any idea why this would hang? Perhaps I need to install something?

Thank you for your response!


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • September 28, 2017

Where is vsql installed? Typically is installed in C:\Program Files\Vertica Systems\VSQL64.

So I can run it like this:

PS & 'C:\Program Files\Vertica Systems\VSQL64\vsql' -h 10.10.1.10 -d MY_DATABASE

Note that if you pass in a bogus IP where Vertica is not running it may take a minute for vsql to report a connection timeout. For example, I ran the above command in PowerShell, and it took about 18 seconds for me to get the "vsql: could not connect to server:..." message. You might think its hanging.

PS C:\> & 'C:\Program Files\Vertica Systems\VSQL64\vsql' -h 10.10.1.10 -d MY_DATABASE
vsql: could not connect to server: Connection timed out (0x0000274C/10060)
        Is the server running on host "10.10.1.10" and accepting
        TCP/IP connections on port 5433?