Can not connect to user with password with \c meta-command

Moderator: NorbertKrupa

Post Reply
User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Can not connect to user with password with \c meta-command

Post by Julie » Mon Jun 16, 2014 12:36 pm

Hey,

I'm playing around with Vertica 7.0.1 and noticed a weird issue while trying to change users in vsql. If the user has a password, then Vertica does not ask for the password and presents an error.

If the user does not have a pw I can change to the user fine:

Code: Select all

dbadmin=> create user julie;
CREATE USER

dbadmin=> \c dbadmin julie;
You are now connected to database "dbadmin" as user "julie".

dbadmin=> \c dbadmin dbadmin
You are now connected to database "dbadmin" as user "dbadmin".

dbadmin=> drop user julie;
DROP USER
But if the user has a pw, I get an error!

Code: Select all

dbadmin=> create user julie identified by 'julie1';
CREATE USER

dbadmin=> \c dbadmin julie
FATAL 3781:  Invalid username or password
Previous connection kept
Odd :( In previous versions, didn't we get prompted for the password?
Thanks,
Juliette

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: Can not connect to user with password with \c meta-comma

Post by id10t » Mon Jun 16, 2014 10:10 pm

Hi!

[DELETED]
Last edited by id10t on Wed May 06, 2015 5:15 pm, edited 1 time in total.

User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Re: Can not connect to user with password with \c meta-comma

Post by Julie » Wed Jun 18, 2014 12:06 pm

Thanks for getting back to me, sKwa. I tried the --no-vsqlrc option, no luck:

Code: Select all

[dbadmin@vertica-1 ~]$ vsql --no-vsqlrc
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=> create user julie identified by 'julie1';
CREATE USER

dbadmin=> \c dbadmin julie
FATAL 3781:  Invalid username or password
Previous connection kept
dbadmin=>
It's weird, I can log on fine like this:

Code: Select all

[dbadmin@vertica-1 ~]$ vsql -U julie -w julie1
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

julie=>
Thanks,
Juliette

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: Can not connect to user with password with \c meta-comma

Post by id10t » Wed Jun 18, 2014 1:36 pm

Hi!

[DELETED]
Last edited by id10t on Wed May 06, 2015 5:12 pm, edited 1 time in total.

User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Re: Can not connect to user with password with \c meta-comma

Post by Julie » Thu Jun 19, 2014 2:16 pm

sKwa, thanks for your help on this :)

Here is my output:

Code: Select all

[dbadmin@vertica-1 ~]$ vsql --version
vsql version 07.00.0100, built for Linux64, contains support for command-line editing
[dbadmin@vertica-1 ~]$ /opt/vertica/bin/vertica --version
Vertica Analytic Database v7.0.1-0
vertica(v7.0.1-0) built by release@build2.verticacorp.com from releases/VER_7_0_RELEASE_BUILD_1_0_20140212@130255 on 'Wed Feb 12 19:00:56 America/New_York 2014' $BuildId$
Thanks,
Juliette

User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Re: Can not connect to user with password with \c meta-comma

Post by Julie » Thu Jun 19, 2014 2:24 pm

sKwa,

I think I may have figured something out. I am setting the VSQL_PASSWORD variable in the the dbadmin's users .bash_profile. If I comment that line out and then re-log in again, then when I launch vsql and attempt to swicth to the julie user, I am prompted for a password as expected! So, apparently when using the \c meta-command Vertica tries using the password from the VSQL_PASSWORD variable. That seems dumb. Do you think this is the issue?
Thanks,
Juliette

Post Reply

Return to “vSQL”