Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

create new user in postgres

CREATE USER visualscrapy WITH PASSWORD '123456';
# it will create the new user in postgres
Comment

how to create a new user in postgresql

CREATE DATABASE yourdbname;CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass';GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser;
Comment

postgresql create user

CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass';
GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser;
Comment

postgres create admin user with password

sudo -u postgres createuser -s -i -d -r -l -w <<username>>
sudo -u postgres psql -c "ALTER ROLE <<username>> WITH PASSWORD '<<password>>';"
Comment

psql create user

# https://www.postgresql.org/docs/8.0/sql-createuser.html
CREATE USER <username> WITH PASSWORD '<password>' VALID UNTIL '<date here>';
Comment

Create user in Postgres

CREATE ROLE <username> WITH LOGIN PASSWORD '<pwd>';
Comment

Make a user in Postgresql

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;
Comment

create user postgres with password

create user myuser with encrypted password 'mypass';
Comment

postgres server add user

sudo -u postgres createuser -e <name>
Comment

create user and password postgres

dropuser username
Comment

postgre create user

#!/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
Comment

PREVIOUS NEXT
Code Example
Shell :: run anydesk from terminal ubuntu 
Shell :: install pypy on ubuntu 
Shell :: changed files git 
Shell :: install protobuf windows 
Shell :: install lua in ubuntu 
Shell :: ubuntu kill running port 
Shell :: github commands 
Shell :: github pull request template 
Shell :: pyglet linux 
Shell :: shopify cli 
Shell :: stop all docker machiens 
Shell :: brew install rosetta 
Shell :: create github repository 
Shell :: install zabbix 
Shell :: string powershell 
Shell :: installing docker compose on ec2 
Shell :: pendrive bootable using terminal 
Shell :: how to validate a mobile number in shell script 
Shell :: activer core dumped linux 
Shell :: he5 command line 
Shell :: apt mailbox debian 10 
Php :: tinker lost color cli 
Php :: check laravel version 
Php :: php remove numbers from string 
Php :: get current user first and last name wordpress 
Php :: php get last modified date of file 
Php :: wordpress check user against user roles 
Php :: the_post_thumbnail add class 
Php :: rewrite .php to no extension 
Php :: composer install ignore 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =