天天看点

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文件导入到数据库中