putty导出、导入数据库

时间:2023-03-09 00:13:11
putty导出、导入数据库

e.g 从223服务器导数据库的t_marine_area到227服务器

用putty连接223服务器

导出数据库命令:
pg_dump -h localhost -U postgres -d marine  >marine.sql

导出数据库表命令:
pg_dump -h localhost -U postgres -d marine -t t_marine_area >t_marine_area.sql

导入数据库表命令:
psql -h putty导出、导入数据库192.168.1.227 -U postgis --port 5430 -W -d weather < marine.sql