Skip to main content
Question

Can VSQL be used by other than dbadmin users?

  • March 27, 2020
  • 7 replies
  • 14 views

AnuskaWR
Forum|alt.badge.img+1

I have created a few Vertica users with access to database. How can these users use vsql if the first prompt is for password to database? Database password is dbadmin user password, so in essence these users with be logging with dbadmin access and not their own access.
How can users, other than dbadmin, use vsql to work with database?

7 replies

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • March 27, 2020

Yes. it can be used by other users. You need to use -U while running the vsql command

-bash-4.1$ vsql -U test
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

INFO: Connected to localhost at port 5433.

test=>

https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/ConnectingToVertica/vsql/CommandLineOptions.htm


AnuskaWR
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • March 27, 2020

Sruthi, I am able to access the database via DBVis, but using vsql, I get:
vsql: FATAL 2248: Authentication failed for username


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • March 27, 2020

Please double check the password you are typing in.. if it still fails with vsql but works with DbViz... please open a support case with screenshots and logs.


AnuskaWR
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • March 27, 2020

Thanks Will do. Yes, password is correct.


DaveT
Forum|alt.badge.img
  • Participating Frequently
  • March 27, 2020

One theory is that you have an authentication method that is preventing this. For example, it is possible if you tried vsql locally that an authentication rule prevented it whereas DBVis worked because it was not a local attempt. Here is an example where user "doug" is rejected locally but not when I provide a host. This is due to an authentication rule that prevent this user from connecting locally.
vsql -U doug -w password123 -c "select 1 c1"
vsql: FATAL 2248: Authentication failed for username "doug"

But this works:
vsql -U doug -w password123 -h sandbox1 -c "select 1 c1"

c1

1
(1 row)


AnuskaWR
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • March 27, 2020

Thanks Doug, yes, I do have authentication (local_hash) assigned to these users. I tried your method and yes, it worked when I passed the host name. Appreciate the help!


mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • March 27, 2020

When you create a single authentication method, the intent is to lock things down.
See: https://www.vertica.com/blog/authentication-methods-dbadmin