Jump to content

Recommended Posts

Posted

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!

Posted

Try taking out ODBC 3.51

That fixed my problem with an MySQL connection string problem before

 

Edit: And if I remember correctly I was getting that same error

Posted

Try Sungazer's suggestion; otherwise, I'm not sure we even offer ODBC. Why not just use the PHP MySQL library?

Posted

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?

Posted

I'm not sure that MySQL is compatible with ODBC, but if it is - all the more power to you. For the record, we are running MySQL 5.

Posted

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.

  • 5 weeks later...
Posted

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!

 

Posted

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.

Posted

I went ahead and wrote a quick test page to see if we have the ODBC driver. It seems that you are correct. I will look into this and get back to you ASAP.

Posted

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.

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...