vytvořit db user postgres
sudo -u postgres psql
postgres=# create database mydb;
postgres=# create user myuser with encrypted password 'mypass';
postgres=# grant all privileges on database mydb to myuser;
psql vytvořit uživatele
# https://www.postgresql.org/docs/8.0/sql-createuser.html
CREATE USER <username> WITH PASSWORD '<password>' VALID UNTIL '<date here>';
vytvořit Postgres uživatele a hesla
dropuser username
vytvořit a připojit uživatele k databázi postgresql
sudo -u postgres psqlpostgres=# create database mydb;postgres=# create user myuser with encrypted password 'mypass';postgres=# grant all privileges on database mydb to myuser;
Jak mohu přidat uživatele do databáze postgres? cli
psql=# grant all privileges on database <dbname> to <username>
Jak mohu přidat uživatele do databáze postgres? cli
GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser;