我希望从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
发布评论