evans
evans

Reputation: 563

How to convert mysql database dump to postgresql?

My file dump.sql for MySQL

MySQL dump 10.13  Distrib 5.7.20, for Win64 (x86_64)

in file set encoding cp1251
Error in the normal recovery psql databasename < /path/to/dump/dump.sql:

ERROR:  invalid byte sequence for encoding "UTF8": 0xd3 0xc0

I need to convert it so that it can be restored in postgresql.
Are there any plugins? or ways?

Upvotes: 1

Views: 2082

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246093

You can tell psql what the encoding of the SQL script is:

PGCLIENTENCODING=WIN1251 psql -d databasename -f /path/to/dump/dump.sql

Upvotes: 3

Related Questions