I am using version 4.0 and and tried both connectors versions 5.1 and the 3.51 but i am still getting the same error if i try the version 5 it tells me that it cannot find the data source and if i use the verison 3.5 i get the error i mentioned previousely.
No sir the only time i can do it is from my machine but when i upload the files to my site i could not i am still looking for answers if you have any please forward them to me i got my public server which i can connect to locally but outside my machine is
negative...
It sounds like that you do not have full access to this server, thus it blocks the connection to your database from the outside. First, you need to look at your security settings to make sure that your ASPNET user has access to your MySQL database. Secondly,
you need to make sure that the ports are opened to the outside.
Christopher Reed, MCT, MCPD, MCTS, Microsoft Specialist, MTA
"The oxen are slow, but the earth is patient."
This is correct. While I thought that I added my IP address/Class C to the Remote MySQL Access Host list (which is located in cPanel, if that's what your host is using), I forgot that I was connecting from a different location. Once I added my IP address,
everything worked perfectly.
Here is the connection code I used to get my desktop application to work. Specifically, I am using Microsoft Visual Basic 2010 Express with MySQL ODBC Driver 5.1 in a Microsoft Windows XP 32-bit environment. The server I connected to is a Linux shared server
running cPanel 11.30.3 (build 5) and MySQL version 5.1.59
Below is the code I used to connect. I hope it helps others out there.
Sub OpenMySQLConnection() Dim mConnection As Odbc.OdbcConnection
' First, build a connection if one doesn't already exist If mConnection Is Nothing Then mConnection = New Odbc.OdbcConnection
' Is the connection is already open? If so, close it. If mConnection.State = ConnectionState.Open Then mConnection.Close()
' Initialize a few local variables to store the MySQL username, password, location, driver name and database name. Dim username As String = "mySQLusername" Dim password As String = "mySQLpassword" Dim server As String = "somewhere.doc" Dim driver As String = "{MySQL ODBC 5.1 Driver}" Dim database As String = "mySQLdatabaseName"
' Now attempt to open the connection to the database mConnection.ConnectionString = myConnectionString Try mConnection.Open() Catch ex As Exception 'Unable to connect. To read the error, add this to a message box somewhere: ex.ToString 'For example: MsgBox("Unable to connect due to the following error: " & ex.ToString) 'Write code below to execute more steps since you're unable to connect. End Try
' See if the connection state opened correctly (successfully) If mConnection.State <> ConnectionState.Open Then 'Execute code if an error occurred while attempting to open ElseIf mConnection.State = ConnectionState.Open Then 'All is well! Insert additional code to manipulate database here End If End Sub
masterpage1
Member
418 Points
250 Posts
ODBC connector for mysql
May 08, 2009 07:00 PM|LINK
anybody had an idea about
ODBC connector
i am trying to test my connection to mysql but after i entered all my information i am getting the following messagebox error:
Connection Failed:[HY000][MySQL][ODBC 5.1 Driver] Unknown system variable 'character_set_results'
I don't know what is the problem at this point looking for answers???
Careed
All-Star
18774 Points
3637 Posts
Re: ODBC connector for mysql
May 08, 2009 07:31 PM|LINK
What version of MySQL are you using? If it's older than 5.1, then you might want to consider using an older version of the ODBC driver.
"The oxen are slow, but the earth is patient."
masterpage1
Member
418 Points
250 Posts
Re: ODBC connector for mysql
May 11, 2009 02:37 PM|LINK
I am using version 4.0 and and tried both connectors versions 5.1 and the 3.51 but i am still getting the same error if i try the version 5 it tells me that it cannot find the data source and if i use the verison 3.5 i get the error i mentioned previousely.
Thanks
Careed
All-Star
18774 Points
3637 Posts
Re: ODBC connector for mysql
May 12, 2009 08:43 PM|LINK
Have you ever been able to connect to a MySQL database through the ODBC connector and .NET?
"The oxen are slow, but the earth is patient."
masterpage1
Member
418 Points
250 Posts
Re: ODBC connector for mysql
May 28, 2009 07:01 PM|LINK
No sir the only time i can do it is from my machine but when i upload the files to my site i could not i am still looking for answers if you have any please forward them to me i got my public server which i can connect to locally but outside my machine is negative...
Thanks
masterpage1
Member
418 Points
250 Posts
Re: ODBC connector for mysql
May 28, 2009 07:03 PM|LINK
and here is my connection string
strconnection =
New OdbcConnection("DRIVER={mySQL ODBC 3.51 Driver};myserveraddress;Port=3306;Stmt=;DATABASE=databasename;UID=username;PASSWORD=password;OPTION=3;")Careed
All-Star
18774 Points
3637 Posts
Re: ODBC connector for mysql
May 29, 2009 06:15 PM|LINK
It sounds like that you do not have full access to this server, thus it blocks the connection to your database from the outside. First, you need to look at your security settings to make sure that your ASPNET user has access to your MySQL database. Secondly, you need to make sure that the ports are opened to the outside.
"The oxen are slow, but the earth is patient."
tonewilliams
Member
4 Points
3 Posts
Re: ODBC connector for mysql
Nov 13, 2011 03:40 PM|LINK
This is correct. While I thought that I added my IP address/Class C to the Remote MySQL Access Host list (which is located in cPanel, if that's what your host is using), I forgot that I was connecting from a different location. Once I added my IP address, everything worked perfectly.
Here is the connection code I used to get my desktop application to work. Specifically, I am using Microsoft Visual Basic 2010 Express with MySQL ODBC Driver 5.1 in a Microsoft Windows XP 32-bit environment. The server I connected to is a Linux shared server running cPanel 11.30.3 (build 5) and MySQL version 5.1.59
Below is the code I used to connect. I hope it helps others out there.
micheel3000
Member
26 Points
23 Posts
Re: ODBC connector for mysql
Jul 18, 2012 10:36 AM|LINK
You have to put the connection string in the web.config file.
Micheel3000