0

When I try to connect to a MySQL Database from my .NET application i keep getting the error:

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I went to this URL and downloaded/installed the Windows, MSI Installer Connector-ODBC but I am still getting the error. Is there something else I should be doing to get this to work?

This is the connection string I am using:

<add name="sfc" connectionString="DRIVER={MySQL ODBC 5.1 Driver};SERVER=111.111.111.111;PORT=3306;DATABASE=dbname;USER=username;PASSWORD=password;OPTION=0;" />

1 Answer 1

1

Check that the ODBC driver is properly installed (run odbcad32.exe and go to the drivers tab)

Anyway, you should use the native ADO.NET provider rather than the ODBC driver, it's more efficient.

Sign up to request clarification or add additional context in comments.

7 Comments

What do I look for in the drivers tab? This is the first time i've ever used MySQL with .net and this was the only way I could get it to work. Can you elaborate on what you mean by "use the native ADO.NET provider rather than the ODBC driver"?
Also, when I say "get it to work" i'm talking about on my hosting environment (godaddy). I'm having the problem on my development environment.
@Abe Miessler Use dev.mysql.com/downloads/connector/net instead of the ODBC driver.
what should my connection string look like then? Can I still use a SQLDataSource with that?
@Abe, I mean use the MySQLConnection, MySQLCommand etc classes instead of OdbcConnection, OdbcCommand, etc. And yes, you can still use a SqlDataSource with this provider. You need to specify "MySql.Data.MySqlClient" as the provider name
|

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.