postgresql備份與恢復(fù)相關(guān)命令
--備份用戶的數(shù)據(jù)庫bct的所有內(nèi)容
pg_dump -U 用戶名 -d 庫名 -f xxxXXXxxx.sql
--刪除原有數(shù)據(jù)庫
dropdb -U 用戶名 -f 庫名
--創(chuàng)建數(shù)據(jù)庫
createdb -U 用戶名 -f 庫名
--恢復(fù)數(shù)據(jù)庫
psql -U 用戶名 -d 庫名 -f xxxXXXxxx.sql
備份
pg_dump -c -U bct -d bct -f dump_202109102026.sql
還原
psql -U bct -d bct -f dump_202109102026.sql

浙公網(wǎng)安備 33010602011771號