天天看點

postgresql怎麼恢複資料庫

1.切換到postgres使用者 : sudo su - postgres

2.psql進入postgresql指令行

3.create database createdbxxx

4. Ctrl+Z退出postgresql指令行

5. 恢複資料庫: pg_restore -d xxx(上述建立的資料庫) backup_filepath(備份檔案路徑)

參考連結:

http://www.ruanyifeng.com/blog/2013/12/getting_started_with_postgresql.html

https://codeday.me/bug/20180824/228265.html