将postgreSQL数据迁移到mysql [英] migrate postgreSQL data to mysql

查看:1348
本文介绍了将postgreSQL数据迁移到mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望从musicbrainz db中获取一些数据,以便在基于mysql的应用程序中使用。

I'm looking to grab a few bits of data from musicbrainz db to use in a mysql based app.

我不需要整个数据库,并且一直在寻找'迁移'postgreSQL到mysql,这似乎很多人都有困难。

I don't need the entire database, and have been looking at 'migrating' postgreSQL to mysql, which it seems lots of people have difficulty with.

将postgreSQL数据转储到逗号分隔的文本文件,然后将其导入mysql不是最简单的吗?

Wouldn't it be simplest to just dump the postgreSQL data into a comma-delimited text file, and then import that into mysql?

我刚刚开始使用它,甚至还没有安装postgreSQL,但是试着展望我将如何做到这一点。

I'm just getting started with this, and don't even have postgreSQL installed yet, but trying to look ahead at how I'm going to do it.

推荐答案

您可以使用COPY(在psql客户端中)转储单个表。

You can use COPY (in the psql client) to dump a single table.

或者您可以将pg_dump与 -d 参数一起使用。这将导致pg_dump转储INSERT语句,您可以对MySQL服务器执行该语句。您显然需要首先移植模式 - 并假设MySQL中存在使用的数据类型。

Or you can use pg_dump with the -d parameter. This will cause pg_dump to dump INSERT statements, which you can just execute against your MySQL server. You will obviously need to port the schema first - and assuming the datatypes that are used exist in MySQL.

这篇关于将postgreSQL数据迁移到mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆