我想从我的postgresql数据库备份所有内容。我有2个网站,我的活的一个和开发者之一。所有的代码都是同步的,我只是想将所有的数据拷贝到开发站点去做一些测试,然后添加数据,然后将其复制回来。备份来自postgreSQL数据库(Django站点)的所有数据
我试过通过postgres网站上的文档,我现在有运气。
命令我跑做倾倒/恢复:
pg_dump db_name > joshtestdump
psql dbname < joshtestdump –
当我运行的第一个命令转储数据库,我收到以下错误信息:
pg_dump: [archiver (db)] connection to database "db_name" failed: FATAL: Ident authentication failed for user "josh"
我想补充,数据库的用户名和密码是空白的。这对任何事情都有影响吗?
我是新来的postgreSQL和网上的每个教程几乎都做同样的事情。
请让我知道你是否需要更多的细节!
这里是我的DB细节:
DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'db_name' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
感谢,
乔希
修订
我使用了一个python-psycopg2解决方案:生成使得副本为db的sql – 2012-07-18 15:27:00
这是怎么做的? – 2012-07-19 14:15:22