天天看點

postgresql:資料庫導入導出

版權聲明:歡迎轉載,請注明沉默王二原創。 https://blog.csdn.net/qing_gee/article/details/45010021

  1. 通過我的電腦-》屬性-》進階-》環境變量将postgre加入到系統變量中,否則你就通過cmd進入到postgre所在bin目錄下,再進行下一步操作
  2. pg_dump -U postgres starxxxx > starxxxx.sql指令,把資料庫導出到一個sql檔案中
  3. psql -U postgres starxxxx < starxxxx.sql指令,把sql檔案導入到資料庫中