Jump to content

MySql ODBC Driver?


joten

Recommended Posts

I am trying to connect to the MySql database with ASP .NET using ODBC.

 

I can access my local MySql server on my local machine with the connection string: Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;

 

What ODBC driver should I use on Heliohost? He doesn't seem to find one. I get the error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified

 

Or is there any other way to access?

 

Thanks for the help!

Link to comment
Share on other sites

Thanks for the suggestion Sungazer but I still get the same error. Do you have a working MySql connection in ASP.NET on heliohost?

 

@djbob: I'm working with ASP.NET code on the pages, so a combination with PHP is - in my opinion - not possible. Or is it?

Link to comment
Share on other sites

No the project Im working with at the moment is not on the heliohost servers, although I will be implamenting the same sort of tech on my heliohost page. (hopfully)

 

And yes MySQL is compatible with ODBC, I am using this combo on the afore mentioned project.

 

The current working driver line looks similar to this... with obvious changes made to protect the integrity of the server.

Driver={MySQL Driver};server=a.mysqlserver.com;database=dbname;option=3;uid=userid;pwd=thepassword" providerName="System.Data.Odbc"

 

The original driver line that gave me trouble looked similar to this... again with obvious changes made...

Driver={MySQL ODBC 3.51 Driver};server=a.mysqlserver.com;database=dbname;option=3;uid=userid;pwd=thepassword" providerName="System.Data.Odbc"

 

Edit: Oh and by the way, the line that does not work for me worked when tested on a different web server.

Link to comment
Share on other sites

  • 5 weeks later...

The MySQL ODBC connection works fine now using remote SQL from my localhost with ASP.NET. So MySQL is definitely compatible with ODBC. When attempting the same on 'stevie', I get the error 'libodbc.so'. http://bouwproject.heliohost.org/Nieuws2.aspx

 

I suppose there is a driver missing on the webserver? Is there any chance you could install that (cause PHP is no option in my case)? I suppose other (existing or future) members could also benefit from it?

 

Thanks for looking into this!

 

Link to comment
Share on other sites

I'm getting a 503 error. Where are you getting the "libodc.so" error from?

 

I suppose there is a driver missing on the webserver?
It is very possible that our version of the .NET Framework, which is based on the Mono Project's open source reconstruction, is missing the ODBC package. I'll take a look.

 

UPDATE

No, it seems that we should have the ODBC driver. See here for more information.

Link to comment
Share on other sites

OK, after fiddling around for a number of hours I finally got ODBC working with MySQL. The connection string follows:

 

DRIVER={MySQL ODBC 3.51 Driver};Server=localhost;Database=your_mysql_database;User=your_mysql_user;Password=your_mysql_passw
ord;Option=3;

 

Let me know if that works. Note: that string is case sensitive.

Link to comment
Share on other sites

Sure :)

I just fiddled around some more and it seems that the MySQL Connector/NET driver is recommended over the MySQL Connector/ODBC driver. I went ahead and installed the Connector/NET driver as well, and after dealing with the expected bugs I have it working with ProviderName="MySql.Data.MySqlClient" and the following connection string:

 

Server=localhost;Database=your_mysql_database;User=your_mysql_user;Password=your_mysql_password;

 

If you're not particularly set on ODBC, you might want to try that. Otherwise, both seem to work 100% so there probably isn't much of a difference outside of performance.

See here for more information.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...