OS
2015.11.21 11:45
[PostgreSQL] DB 덤프 & 복구
조회 수 66283 추천 수 0 댓글 1
[PostgreSQL] DB 덤프 & 복구
DataBase 2010.01.05 11:33
[덤프]
/usr/local/pgsql/bin/pg_dump -U [USERNAME] [DB_NAME] -t TABLE_NAME -f DUMP_FILE_PATH
ex)
USER : bloodguy
DB_NAME : my_site
SCHEMA : bloodguy
TABLE : board_1
FILE_PATH : /tmp/board_1.sql
pg_dump -U user_000 cell_000 -f BACKUP.sql
[복구]
/usr/local/pgsql/bin/psql -U USER_NAME -d DB_NAME < SQL_FILE_PATH
ex)
/usr/local/pgsql/bin/psql -U bloodguy -d my_site < /tmp/board_1.sql
psql -U user_000 -d cell_000 < 파일.dump
URL: http://bloodguy.tistory.com/entry/PostgreSQL-DB-%EB%8D%A4%ED%94%84-%EB%B3%B5%EC%88%98
비번변경:
http://guyaga.tistory.com/33
ex>
psql -U user_000 -d cell_000
ALTER USER user_000 WITH ENCRYPTED PASSWORD '*********';