首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将mysql数据库转换为pg数据库

问将mysql数据库转换为pg数据库
EN

Stack Overflow用户
提问于 2014-05-20 02:44:43
回答 1查看 48关注 0票数 0

所以,我使用的是mysql2psql gem,我得到了以下代码:

代码语言:javascript
复制
mysql:
 hostname: localhost
 port: 3306
 socket: /tmp/mysql.sock
 username: root
 password: root
 database: hello_development

destination:
 # if file is given, output goes to file, else postgres
 file: 
 postgres:
  hostname: localhost
  port: 5432
  username: root
  password: root
  database: hello_development

# if tables is given, only the listed tables will be converted.  leave empty to convert all tables.
#tables:
#- table1
#- table2
# if exclude_tables is given, exclude the listed tables from the conversion.
#exclude_tables:
#- table3
#- table4


# if supress_data is true, only the schema definition will be exported/migrated, and not the data
supress_data: false

# if supress_ddl is true, only the data will be exported/imported, and not the schema
supress_ddl: false

# if force_truncate is true, forces a table truncate before table loading
force_truncate: false

不过我有点困惑,我不知道如何转换我所有的表,例如测试和生产。目前,看起来我只是在转换hello_development。

请多多指教!

EN

回答 1

Stack Overflow用户

发布于 2014-05-20 02:55:27

您指定了要使用的数据库- database: hello_development -这就是为什么它只在您的开发环境中运行的原因。您还需要为测试和生产环境中的mysql2pgsql创建配置文件。

过去使用过mysql2pgsql,请记住,mysql和postgres的工作方式可能有很多不同-在生产环境中运行此脚本之前,请确保您已经在开发环境中完全测试了您的应用程序。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23744988

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档