Problem connecting to MySQL server with DbExplorer

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Matzen
Posts: 6
Joined: Wed 20 Apr 2005 14:16

Problem connecting to MySQL server with DbExplorer

Post by Matzen » Wed 20 Apr 2005 14:20

Hi,
I'm having difficulties connecting to my MySQL server which is on a remote server. I've connected successfully with MySQL Administrator so I know that the connection string is correct.
Is this a known problem or am I doing something wrong?
I'm running MySQL 4.1.7 and using the latest MySQLDirect.NET release.
Some help would be greatly appreciated, I've been going crazy over this all day... :(

Serious

Post by Serious » Wed 20 Apr 2005 14:49

Please share your connection string on forum (without password of course).

Matzen
Posts: 6
Joined: Wed 20 Apr 2005 14:16

Here's my connectionstring, with a masked password ;)

Post by Matzen » Thu 21 Apr 2005 09:11

Host=slottsservern;User Id=mats;Password=xxx;

It's a pretty standard connectionstring. I've tried using the ip of the servern but I get the same error.
It's really bugging me since I can connect to it from mysqladministrator but I really want to use DbExplorer.

Serious

Post by Serious » Thu 21 Apr 2005 09:18

You need to specify "database" parameter.
Example: "Host=slottsservern;User Id=mats;Password=xxx;database=mysql"

Matzen
Posts: 6
Joined: Wed 20 Apr 2005 14:16

Post by Matzen » Thu 21 Apr 2005 09:26

I tried, still doesn't work :(

Here's my connectionstring now:
Host=slottsservern;User Id=mats;Password=xxx;Database=mysql;

The error I get is
'Access denied for user 'mats'@'192.168.0.12' (using password: YES)

I have that user with that hostname added to mysql.

Serious

Post by Serious » Thu 21 Apr 2005 09:49

Check your connection parameters with standard MySQL client.
Command line arguments: mysql -h slottsservern -u mats -D mysql -p

Matzen
Posts: 6
Joined: Wed 20 Apr 2005 14:16

Post by Matzen » Thu 21 Apr 2005 10:55

I sort of did, with mysqladministrator. Connecting works in there...

Matzen
Posts: 6
Joined: Wed 20 Apr 2005 14:16

Post by Matzen » Thu 21 Apr 2005 12:21

I installed 2.80 but I get the same error :\

Serious

Post by Serious » Thu 21 Apr 2005 12:29

Do you use advanced connection options in MySQL Administrator connection dialog (SSL support or named pipe)?

Matzen
Posts: 6
Joined: Wed 20 Apr 2005 14:16

Post by Matzen » Thu 21 Apr 2005 12:39

Hey, I made it work... :D
I changed some settings on the mysql server. I think named pipes may have been the reason for my errors. I disabled it on the server and now it works.

Thanks for the help, excellent support here!
I'm really happily surprised with how fast you answered my questions.

Movstheman
Posts: 8
Joined: Sun 10 Dec 2006 02:40

Post by Movstheman » Sun 10 Dec 2006 03:01

I'm having the same problem. However the message says ..........

Can't connect to MySQL server on '192.168.0.2' (10061)

When I view more information in the Visual Studio debugger it says:

DeviceApplication1.exe!DeviceApplication1.Form1.CreateMySqlConnection() Line 41 + 0x6 bytes C#

Further in the debugger............

HostInfo 'oMySqlConn.HostInfo' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}

Further Still..............

- base {"Connection must be opened."} System.SystemException {System.InvalidOperationException}

My connection is also basic, it is ......

using CoreLab.MySql; (at the top)

MySqlConnection oMySqlConn = new MySqlConnection();

oMySqlConn.ConnectionString = "User ID=root;" + "Password=root;" + "Host=192.168.0.2;" + "Port=3306;" + "Protocol=TCP;";

oMySqlConn.Open();

I'm am using the Pocket PC emulator with Visual Studio 2005 pro, MySQLDirect .NET mobile and a MySQL database. It does not run, I have also put these statements in a "try" and "catch" block to catch the exception but it still does not work.

I have:

- disabled My firewall
- disabled SSL support or named pipe
- Ensure that TCP/IP connection is enabled on port 3306

Can anyone give me so pointers?? I'm pretty sure the connection string is correct but for some reason the connection status stays closed even tho I have used the oMySqlConn.Open(); command. Does anyone know if something else is blocking the port or stopping the connection??

PLEASE HELP ASAP!!!!!!

Movstheman
Posts: 8
Joined: Sun 10 Dec 2006 02:40

Post by Movstheman » Sun 10 Dec 2006 12:49

** Update - I have also specified the database in the connection string so I know this is not the problem...........

"database=mysql;"

(I just didnt copy when I put in this post)

Thanks

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 11 Dec 2006 08:45

When do you get the error? On oMySqlConn.Open(); string?

Movstheman
Posts: 8
Joined: Sun 10 Dec 2006 02:40

Post by Movstheman » Mon 11 Dec 2006 09:25

I get the error during the debug stage of the compilation. Visual Studio will compile the code and deploy to the pocket pc emulator. It will then start to load and the dbugger will kick in a re-open Visual Studio saying the it can connect to the database (it say further down the tree that a connection must be opened - every though I using the myconnection.Open(); command)

Is it anything to do with having the trial version?

Can you let me know how all the setting in MySQL administrator need to be setup?

Thanks

Could you reply asap please because I can test it right now (Or could you send me contact a number to [email protected])

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 11 Dec 2006 14:04

Seems like the problem of your emulator. Have you performed "cradle" action?

Post Reply