Reset Password

Moderator: NorbertKrupa

Post Reply
binface
Newbie
Newbie
Posts: 13
Joined: Fri Jun 15, 2012 2:40 pm

Reset Password

Post by binface » Fri Jun 15, 2012 2:43 pm

Is there any way to change a database's password?

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Reset Password

Post by JimKnicely » Fri Jun 15, 2012 3:23 pm

Hi,

You can change a user's password in the Vertica database using the ALTER USER statement:

Example:

Logged in as the admin, I'll create a user jim and then log in as the user jim:

Code: Select all

dbadmin=> create user jim identified by 'pluto';
CREATE USER
dbadmin=> \q
bash-3.2$ vsql -U jim -w pluto
SET
Welcome to vsql, the Vertica Analytic Database v5.0.11-0 interactive terminal.

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

jim=> 
Now that I am logged in as user jim, I can change the password with the ALTER USER command but I have to also supply the old password to do so.

Like this:

Code: Select all

jim=> alter user jim identified by 'venus' replace 'pluto';
ALTER USER
If you are logged in as an admin. you can change the password for any user without supplying the old password.

Like this:

Code: Select all

dbadmin=> alter user jim identified by 'mars';
ALTER USER
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

binface
Newbie
Newbie
Posts: 13
Joined: Fri Jun 15, 2012 2:40 pm

Re: Reset Password

Post by binface » Fri Jun 15, 2012 3:32 pm

Thanks Jim, but I'm actually trying to change the DATABASE password, not a user password. Any ideas?

jpcavanaugh
Intermediate
Intermediate
Posts: 149
Joined: Mon Apr 30, 2012 10:04 pm
Location: New York
Contact:

Re: Reset Password

Post by jpcavanaugh » Fri Jun 15, 2012 4:45 pm

There are only user passwords - no database level password.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Reset Password

Post by JimKnicely » Fri Jun 15, 2012 4:46 pm

I believe that the "database password" is simply the database superuser's password.

If your superuser account is dbadmin, just use the ALTER USER statement:

Code: Select all

ALTER USER dbadmin IDENTIFIED BY 'newpassword';
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

binface
Newbie
Newbie
Posts: 13
Joined: Fri Jun 15, 2012 2:40 pm

Re: Reset Password

Post by binface » Mon Jun 18, 2012 2:14 pm

But how would I log into the database without this password?

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Reset Password

Post by JimKnicely » Thu Jun 21, 2012 6:25 pm

Did you forget the password?

You may be able to edit the vertica.conf file and change the client authentication to trust. By doing so you should be able to run vsql without a password because the OS has already authenticated the user (assuming you can get that far :)).

Please check out the "Implementing Client Authentication" of the Administrator's Guide on page 106.
trust — Authenticates clients based on valid user names only. You might want to implement trust if a user connection has already been authenticated through some external means such as SSL or a fire wall.
Keep in mind that Vertica recommends not editing the vertica.conf file manually. It should be edited via the admintools.

I'd be careful to make backups prior to modifying any files!
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “Vertica Database Administration”