DEV Community

Tao Liu
Tao Liu

Posted on • Updated on

create pgsql user

Alt Text

For example, to create the PostgreSQL username jdoe the command is:

sudo -u postgres createuser -s jdoe
To set a password for this user, log in to the PostgreSQL command line client:

sudo -u postgres psql
At the PostgreSQL prompt, enter the following command to set the password:

\password [username]
For example, to set the password for jdoe the command is:

\password jdoe
Enter and confirm the password. Then exit the PostgreSQL client:

\q

source https://www.ionos.com/digitalguide/server/know-how/use-postgresql-with-ruby-on-rails-on-ubuntu/

Top comments (0)