刹那的菜鸟

博客园 首页 新随笔 联系 管理

PostgreSQL怎么导入sql文件

1、使用命令行(cmd或powershell)进入PostgreSQL安装目录

d:
cd d:\Programe Files\PostgreSQL\10\bin
1
2
2、执行导入语句即可

psql -d mypg -U postgres -f D:\Desktop\db.sql
1
参数解释:

mypg:数据库名
postgres:数据库用户名
D:\Desktop\db.sql:sql文件路径

3、回车之后提示输入用户密码,然后静待完成就可以了。

posted on 2023-12-13 15:45  刹那的菜鸟  阅读(1014)  评论(0编辑  收藏  举报