mySql and Standard Edition
I am trying to connect .NET to mySQL. When I set up an oleDbConnection using an ODBC driver, I get an error message that says "It is only possible to connect to SQL Server Desktop and MS Access databases with this version". Does this mean I need the Professional version of Studio to connect to non-Microsoft products? I have searched the Studio sales site and I can't see where this limitation is mentioned anywhere. Or could this error message be errroneous?
Re: mySql and Standard Edition
Can I use it to connect to a remote MySQL server? Or does MySQL have to be on my development machine?
Re: mySql and Standard Edition
Your db server can be on another machine, just change the server setting in the connectionstring to reach the other machine with the MySql server.
Re: mySql and Standard Edition
Quote:
Originally Posted by ggprogram
I called MicroSoft and they say the message is misleading. They say that Standard edition does not allow you to connect using the visual tools, but that you should be able to do so through the code. So I am trying to connect using ODBC:
Imports Microsoft.Data.Odbc
Module Module1
Sub Main()
Dim MyConString As String
Dim myConnection As OdbcConnection
MyConString = "DRIVER=(People 3.51);SERVER=localhost;DATABASE=test;"
myConnection = New OdbcConnection(MyConString)
myConnection.Open()
End Sub
End Module
where People 3.51 is the DSN name. I get an error at the Open statement, but I am not sure why? So, I am still not sure what is going on. Does this code look correct?
That's because People 3.52 is the DSN name, not the name of the driver (Like Jet or MSSQL or MyODBC, or Oracle, etc)..... It should be as simple as changing the connection string to "DSN=People 3.51;"
Tg
Re: mySql and Standard Edition
Quote:
Originally Posted by sixfeetsix
Your db server can be on another machine, just change the server setting in the connectionstring to reach the other machine with the MySql server.
From the local machine, I can access the MySQL database via a C# web application.
From the remote machine, running the same application, (with dbProvider installed), I get this error
Quote:
Access denied for user ''@'%' to database 'csharpvqs'
If my connection string is this from both machines:
Code:
Data Source=localhost;uid=;pwd=;database=csharpvqs;
Note the blank uid and pwd. If I supply a uid and pwd I get this error:
Quote:
Could not initiate communication with the server.
Any ideas why I cannot connect remotely?
Thanks!
Dave
Re: mySql and Standard Edition
Data Source=localhost
Doesn't that mean that it's trying to find the db on the localmachine? Shouldn't that be the server name, or at least the ip of the remote machine?
Tg
Re: mySql and Standard Edition
you are right, it is just a typo. The remote machine does not use localhost. It uses the name of the remote machine. Any other ideas?
Re: mySql and Standard Edition
If the local machine uses "localhost" in the connect string it works from the local machine.
If the local machine uses "COMPUTERNAME" in the connect string I get the same error as the remote machine:
Quote:
Access denied for user ''@'%' to database 'csharpvqs'
What is happenning? It seems to be forcing windows auth if I use "COMPUTERNAME" in the connect string...
Re: mySql and Standard Edition
Ok, first read the info provided on this site http://www.connectionstrings.com/ under the Mysql->MySqlConnection->eInfoDesigns.dbProvider section.
So according to that section, your connection string should look somewhat like this :
VB Code:
conn.connectionstring = "Data Source=<server's ip or fqdm >;Database=<database name>;User ID=<uname>;Password=<password>;Command Logging=false"
Re: mySql and Standard Edition
I did exactly that and still the same error occurs. Remember, the connection string works from the local machine if Data Source = "localhost" but not if Data Source = "COMPUTERNAME" or "IP ADDRESS".
"localhost" is the only thing that works, and only from the same machine.
Re: mySql and Standard Edition
Sorry bout my last post, but now I understand your problem!
It looks like you did not define access rights for any user outside localhost.
Here is some doc from MySql on how to change your permissions in MySql to allow a user on compute B to access your MySql server on computer A :
http://dev.mysql.com/doc/mysql/en/re...onnection.html.
Note that when it says :
Quote:
GRANT ALL ON *.* to 'myuser'@'B' IDENTIFIED BY 'mypassword';
you can allow a user to access your MySql server from anywhere by useing this query instead :
Quote:
GRANT ALL ON *.* to 'myuser'@'%' IDENTIFIED BY 'mypassword';
Good luck!
3 Attachment(s)
Re: mySql and Standard Edition
I will try this, but it should be noted that I am unable to create users in the database because I am a MySQL n00b. You think that will be a problem? Maybe I instaled it wrong, but the MySQL Admin program barfs when I try to add users saying I don't have persmissions...
From the included pics:
- MySQL_sa shows the error when I try to connect as "sa"
- MySQL_schema shoes the schema setup with the sa username
- MySQL_fetch shows that I can access the Admin program when connecting with blank uid and pwd, but it barfs when I look at usernames.
SHould I reinstall MySQL, or configure something, or just shoot myself?
Re: mySql and Standard Edition
sa in MySql is root.... try it out without a password if you made the installation without changing the root password.
What I posted earlier can be executed through the MySql client, it is a command prompt client you start this way : "mysql -uroot -p".
Re: mySql and Standard Edition
I am using the dbProvider from eInfoDesign and whenever I try to do a test connectio after configuring the Connection String I get a "Lost connection to MySQL server during query" error. Any thoughts?
Re: mySql and Standard Edition
Just a note that, if I'm not mistaken, that connector is not free unless you accept the column count limitation. Below is a link to a free MySQL connector:
http://dev.mysql.com/downloads/connector/net/1.0.html
Re: mySql and Standard Edition
Thanks man for the free MySQL connector link! Just a quick question for ya. How do I declare the connection with that free connector?
Thanks again.
Re: mySql and Standard Edition
I've never actually used it myself, but it follows the same namimg conventions as the standard ADO.NET namespaces I believe. You should be able to add the members to the Toolbox along with the SqlClient and OleDb eqivalents and then add them in the designer, or else add a reference to the assembly to your project and declare your objects in the code window. If I'm not mistaken, everything should be pretty much the same as the SqlClient namespace except that everything has a "My" on the front of the name, e.g. MySqlClient.MySqlConnection. The appropriate connection string is provided on www.connectionstrings.com.