Is there any method to tranfer the data and schema from a postgresql database to mysql?

2 Answers 2


Pg_dump will create a plaintext SQL script with the statements needed to re-create the schema and the data. You can then import this script into mysql. You may need to tweak the script in certain places due to postgres/mysql differences.

  • I don't see why one should have to use a commercial tool for this, but a default pg_dump will require a LOT of tweaking to make it work with mysql. I would suggest a careful reading of the pg_dump man page with special attention to flags like data-only, inserts, schema-only, no-owner, and so on. Even so, indexes will have to be dealt with, and also views if the target mysql version does not support them.
    – bogeymin
    Commented Sep 30, 2011 at 14:23

You can try a tool like Navicat Premium. It can do a structure/data compare or copy between db's. Never tried with postgres, but did from mysql to mssql and v.v.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.