12

I am trying to migrate a postgresql database to mysql following this tutorial: http://mysqlworkbench.org/2012/11/how-to-migrate-postgresql-databases-to-mysql-using-the-mysql-workbench-migration-wizard/

I am experiencing this error when I try to test my connection

Could not connect to Source DBMS [IM002][Microsoft][ODBC Driver Manager] Data soure name not found and no default driver specified (0)(SQLDriverConnect)

ODBC connection string

Driver=psqlodc;SERVER=127.0.0.1;PORT=5432;DATA...

Does anyone know how to correct this error?

Liam
  • 27,717
  • 28
  • 128
  • 190
Brooks Fiala
  • 121
  • 1
  • 3

7 Answers7

10

In my case I was using Windows 64bit and using "PostgreSQL ANSI(x64)" did connect to the Postgres database but it gave errors while migrating the database from Postgres to Mysql. I used the driver "PostgreSQL Unicode(x64)" and it worked. If your data contains unicode characters i.e. non ASCII characters use "PostgreSQL Unicode(x64)" drivers. enter image description here

Javed
  • 5,904
  • 4
  • 46
  • 71
4

I encountered the same error. Here is how I solved it:

  1. I downloaded the drivers from https://www.postgresql.org/ftp/odbc/versions/msi/ (Select the most recent one for x64)

  2. In the Overview form, click on the button "Open ODBC Administrator". Add the recently installed "PostgreSQL ANSI(x64)". Click "Finish".

  3. When you "Start Migration", in the source selection form, use "Driver: PostgreSQL ANSI(x64)"

2

Just quoting Craig Ringer's comment to make it "more visible"

If you have Windows 64Bits then you probably had installed only the 64bit psqlodbc drivers, so all you need is to use e.g.: PostgreSQL ANSI(x64) (I had used that and worked for me)

Just stuck onto it for at least 1h until came into Craig's comment, Thanks man!

Luiz Eduardo
  • 380
  • 4
  • 13
2

For those on Ubuntu install the postgres ODBC drivers:

apt-get install odbc-postgresql
Kris
  • 19,188
  • 9
  • 91
  • 111
1

I followed the official documentation from MySQL Workbench, in which they tell you to set up you ODBC connection as

Name: 'psqlODBC'

This is now the name of the driver. So whatever you have called the name in ODBC will need to match your Driver inside Workbench

enter image description here Name psqlODBC

enter image description here Matches Driver here psqlODBC

And then hopefully you'll get:

enter image description here

Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291
  • that "name" from Mysql Workbench must be the same as name in ODBC - that was my problem!! Thanks – WBAR Aug 30 '21 at 02:01
0

This worked for me (w/ ODBC installed):

  1. Click "Open ODBC Administrator" button
  2. Go to "Drivers" tab
  3. Copy the "Name" Column value from your ODBC and close popup
  4. In tab "Parameters", "Driver" field, Past the "Name" copied
  5. Test connection
tshimkus
  • 1,173
  • 2
  • 17
  • 24
-3

Download and install the MSI package for psqlODBC from http://www.postgresql.org/ftp/odbc/versions/msi/ .

Then connect using the following settings
Driver: PostgreSQL ANSI
Connection method: ODBC (Manually entered parameters)
This worked for me.

Vimal Mathew
  • 575
  • 3
  • 10
  • This does not work. Can you add a little more detail on how this worked for you? How you installed it? What file you downloaded? Version?32 bit? 64bit? Please add more details, I have been struggling on this. – oneofakind Jul 27 '15 at 08:24
  • same comment as above, this answer is so random – ericn May 24 '16 at 08:34