I'm trying to figure out how to add a new connection to MySQL running on a different computer on my network. When I click Project --> New Data Source a list of drivers appears, but none of them are MySQL (see thumbnail) which I have previously installed. I'm using 64-bit Windows 7. The MySQL database is on a computer running 64-bit Windows 8.
I found a tutorial that works (see code below) with a console program, but I want to use Dataset
Private con As New MySqlConnection
Private cmd As New MySqlCommand
Private reader As MySqlDataReader
Private _host As String = "<ip address here>" ' Connect to localhost database
Private _user As String = "<user name here>" 'Enter your username, default is root
Private _pass As String = "<password here>" 'Enter your password
Dim oConn As String
oConn = "Server=""" + _host + """;User Id=""" + _user + """;Password=""" + _pass + """;"
con = New MySqlConnection(oConn)
'Check if the connection is open
If con.State = ConnectionState.Open Then
con.ChangeDatabase("dvd_collection") 'Use the MYSQL database for this example
Dim Sql As String = "SELECT title,date_format(release_date,""%Y-%m-%d"") as Date FROM movies"
cmd = New MySqlCommand(Sql, con)
reader = cmd.ExecuteReader()
'Loop through all the users
Console.WriteLine("Title: " & reader.GetString(0)) 'Get the host
Console.WriteLine("Release Date: " & reader.GetString(1)) 'Get the username
Catch ex As Exception
Console.WriteLine(ex.Message) ' Display any errors.
I don't use either VS2012 or MySql, but based on their support forum, it looks like a lot of people have had issues with this configuration. Do you have the the latest vesion of Connector/Net installed? Based on this: Click Here, the newer releases should offer full VS2012 support.
As a possible workaround, have you tried connecting through ODBC instead?