...
Code Block |
---|
sudo -u postgres psql -c "CREATE USER your_user_id with password 'your_password' superuser;" |
Code Block |
sudo -u postgres psql -c 'create database confluence with owner your_user_id;' |
You can do above as following:
Code Block |
---|
sudo -u postgres psql
create database mydb;
create user myuser with encrypted password 'mypass';
grant all privileges on database mydb to myuser; |
newid;' |
If you want to encode in UTF8, you need to change teamplate0 in UTF8 first
...
Code Block |
---|
CREATE DATABASE db_name OWNER = role_name TEMPLATE = template ENCODING = encoding LC_COLLATE = collate LC_CTYPE = ctype TABLESPACE = tablespace_name CONNECTION LIMIT = max_concurrent_connection WITH ENCODING='UTF8' |
Once you create user successfully, you can try to check by
Code Block |
---|
psql -h localhost -U <your_username> |
To see the database list
Code Block |
---|
\list |
To see the user list
Code Block |
---|
\du |