Showing posts with label postgresql. Show all posts
Showing posts with label postgresql. Show all posts
Create user in postgres
1. sudo -s -u postgres
2. psql
3. CREATE USER <nom_utilisateur>;
4. ALTER USER <nom_utilisateur> WITH ENCRYPTED PASSWORD 'mon_mot_de_passe';
4. \q
5. exit
ALTER Role ms2phadmin CREATEDB;
2. psql
3. CREATE USER <nom_utilisateur>;
4. ALTER USER <nom_utilisateur> WITH ENCRYPTED PASSWORD 'mon_mot_de_passe';
4. \q
5. exit
ALTER Role ms2phadmin CREATEDB;
Labels:
postgresql
Backup & Restore PostgreSQL DB
-- Backup
pg_dump -h localhost -U name_of_user name_of_database > file
-- Restore
psql -U name_of_user -h localhost name_of_database < file
http://www.postgresql.org/docs/8.1/static/backup.html
-- lancer ton fichier depuis une ligne de commande linux
psql -h monserveur -f monfichiersql
pg_dump -h localhost -U name_of_user name_of_database > file
-- Restore
psql -U name_of_user -h localhost name_of_database < file
http://www.postgresql.org/docs/8.1/static/backup.html
-- lancer ton fichier depuis une ligne de commande linux
psql -h monserveur -f monfichiersql
Labels:
postgresql
Tao va xoa CSDL trong postgresql
---- Tao CSDL trong postgresql
1. sudo -s -u postgres
2. psql
3. CREATE DATABASE name_of_database WITH OWNER = name_of_user ENCODING = 'UTF8';
4. \q
5. exit
---- Delete CSDL trong postgresql
1. sudo -s -u postgres
2. psql
3. DROP DATABASE name_of_database;
4. \q
5. exit
-- Xem danh sach CSDL hien co
select d.datname as name from pg_catalog.pg_database d;
1. sudo -s -u postgres
2. psql
3. CREATE DATABASE name_of_database WITH OWNER = name_of_user ENCODING = 'UTF8';
4. \q
5. exit
---- Delete CSDL trong postgresql
1. sudo -s -u postgres
2. psql
3. DROP DATABASE name_of_database;
4. \q
5. exit
-- Xem danh sach CSDL hien co
select d.datname as name from pg_catalog.pg_database d;
Labels:
postgresql
To install PostgreSQL
http://doc.ubuntu-fr.org/postgresql
https://help.ubuntu.com/community/PostgreSQL
https://help.ubuntu.com/8.04/serverguide/C/postgresql.html
host all all 127.0.1.1/32 md5
host all all 130.79.79.81/32 md5
https://help.ubuntu.com/community/PostgreSQL
https://help.ubuntu.com/8.04/serverguide/C/postgresql.html
host all all 127.0.1.1/32 md5
host all all 130.79.79.81/32 md5
Labels:
postgresql
pg_restore
pg_restore -h hostname -d databasename -t ilpcover ms2phdb_ilpcover.backup -U username -O
Labels:
postgresql
Subscribe to:
Posts (Atom)