Error when trying to migrate postgresql db to mysql with workbench

試著忘記壹切 提交于 2019-12-04 18:55:47

问题


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?


回答1:


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.




回答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!




回答3:


For those on Ubuntu install the postgres ODBC drivers:

apt-get install odbc-postgresql



回答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)"




回答5:


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

Name psqlODBC

Matches Driver here psqlODBC

And then hopefully you'll get:




回答6:


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.



来源:https://stackoverflow.com/questions/26199390/error-when-trying-to-migrate-postgresql-db-to-mysql-with-workbench

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!