将postgreSQL数据迁移到mysql

编程入门 行业动态 更新时间:2024-10-24 16:22:40
本文介绍了将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

本文发布于:2023-10-15 01:09:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492799.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据   postgreSQL   mysql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!