CREATE USER visualscrapy WITH PASSWORD '123456';
# it will create the new user in postgres
CREATE DATABASE yourdbname;CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass';GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser;
CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass';
GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser;
sudo -u postgres createuser -s -i -d -r -l -w <<username>>
sudo -u postgres psql -c "ALTER ROLE <<username>> WITH PASSWORD '<<password>>';"
# https://www.postgresql.org/docs/8.0/sql-createuser.html
CREATE USER <username> WITH PASSWORD '<password>' VALID UNTIL '<date here>';
CREATE ROLE <username> WITH LOGIN PASSWORD '<pwd>';
CREATE USER jonathan;
CREATE USER davide WITH PASSWORD 'jw8s0F4';
CREATE USER miriam WITH PASSWORD 'jw8s0F4' VALID UNTIL '2005-01-01';
CREATE USER manuel WITH PASSWORD 'jw8s0F4' CREATEDB;
create user myuser with encrypted password 'mypass';
sudo -u postgres createuser -e <name>
dropuser username
#!/usr/bin/env bash
# to execute, open a terminal in directory and run chmod +x <filename>.sh
user="{user name}"
database="{database name}"
args="--host=localhost --dbname=$database --username=$user"
echo -e "Creating user $user.....
"
sudo -u postgres createuser --createdb --pwprompt $user
echo -e "User Created!
"
echo -e "Creating database $database.....
"
sudo -u postgres createdb --owner=$user $database
echo -e "Database Created!
"
echo -e "Restarting server and starting psql....
"
sudo service postgresql restart
psql $args