postgrel 数据库之命令

一、psql命令

1、登录     以下用户名是postgres

psql  -h 127.0.0.1 -p 7496  -U postgres

2、创建数据库

create database  new_database  owner  postgres;

3、给用户grant权限

grant all privileges on all tables in schema public to  postgres;    

4、 备份数据库

 

5、还原数据库

psql -U  postgres  -d  my_database -f  backup_file.sql

 

posted @ 2019-06-11 20:45  亦不饶过岁月  阅读(684)  评论(0编辑  收藏  举报