MySQL and SSL connection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

MySQL and SSL connection

Post by david_labbe » Wed 01 Mar 2006 15:36

Hi,

I have been using successfully the MySQL access components until now. we are moving our database to a secure server. Thus MySQL now uses SSL for the users. I cannot manage to get the connection established with TMyConnection. When I set the SSLOtions with the appropriate certificates and keys and adjust the Options/Protocol to mpSSL, it seem to truncate the mysql user name:

I get the following error:

#28000Access denied for user 'vid'@#192.168.0.10' (using password: YES)

I would have expected [...] for user 'david'@'192.168.0.10' [...]

Of course, the password is set correctly and the certificates and keys are the right ones...

Can you help?

Please don't tell me to refer to the MySQL documentation. I have done that profusely and the problem does not seem to reside there... I can access the database from a shell on the server using the same certificates , keys, ... and it works fine...

If you had working examples of an SSL connection to MySQL, I think it might help.

Cheers
________
HALF-BAKED
Last edited by david_labbe on Fri 18 Feb 2011 15:30, edited 1 time in total.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 02 Mar 2006 10:56

Following the headache I have had, I tried several options.
I checked the ssl libraries are present on the client machine (don't know much about ssl so I thought it might be an issue). I installed OpenSSL anyway.

I tried another MySQL connection component and had to uninstall the crlab ones (conflict of components)... unsuccessfull...
I thus reinstall the crlab components after uninstalling the other ones and I now get a strange error when attempting an ssl connection:


Assertion failure (d:\projects\Delphi\Mydac\Source\MySqlVioTcpSSL, line 87)

funny, I don't have a d drive...

Can anyone please help... I am getting desperate here...

Cheers

David
________
Marijuana Vaporizers
Last edited by david_labbe on Thu 10 Mar 2011 10:06, edited 1 time in total.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 02 Mar 2006 12:26

Specify please, do you use direct connection or not. Does the behaviour changes if you alter Direct option?

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 02 Mar 2006 12:33

Tried to disable the Direct option and got the following message:

MySQL client library couldn't be loaded. Please place libmysql.dll file to system folder (include to PATH) or the folder with executable unit of main program.
________
Harley-davidson peashooter
Last edited by david_labbe on Fri 18 Feb 2011 15:31, edited 1 time in total.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Direct mode = False...

Post by eduardosic » Thu 02 Mar 2006 12:38

david_labbe wrote:Tried to disable the Direct option and got the following message:

MySQL client library couldn't be loaded. Please place libmysql.dll file to system folder (include to PATH) or the folder with executable unit of main program.

With TmyConnection.Option.Direct = False, requiries libmysql.dll, this files are in C:\mySQL\bin\libmysql.dll, put in System Path or in Application Folder.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 02 Mar 2006 12:47

Please copy file libmysql.dll from MySQL Server install path to the path where your project is. Then try again.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 02 Mar 2006 17:00

Tried setting up the libmysql.dll in the right place. Got the latest version (the mysql server is a linux box so no dll's available there) and put it in the right place.

I still get an error in the form of an error dialog box with nothing written in it.
________
Chrysler canada specifications
Last edited by david_labbe on Fri 18 Feb 2011 15:31, edited 1 time in total.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

libmySQL ....

Post by eduardosic » Thu 02 Mar 2006 17:27

david_labbe wrote:Tried setting up the libmysql.dll in the right place. Got the latest version (the mysql server is a linux box so no dll's available there) and put it in the right place.

I still get an error in the form of an error dialog box with nothing written in it.
copy the file libmysql.dll to folder when the exe aplication is present

the application is writed in Delphi/Windows or kylix/Linux ?

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 02 Mar 2006 17:28

I've done that... and my last post was the result...

The application is written in delphi/windows
________
Jugalettes
Last edited by david_labbe on Fri 18 Feb 2011 15:31, edited 1 time in total.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 02 Mar 2006 17:30

The first time around, I got a message telling me that the current version of the mysql client library was not up to date to do ssl authentication, so I upgraded it to the latest and get the dodgy error with no message at all...
________
SUZUKI RG250 SPECIFICATIONS
Last edited by david_labbe on Fri 18 Feb 2011 15:31, edited 1 time in total.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

problem ...

Post by eduardosic » Thu 02 Mar 2006 19:05

david_labbe wrote:The first time around, I got a message telling me that the current version of the mysql client library was not up to date to do ssl authentication, so I upgraded it to the latest and get the dodgy error with no message at all...
the schema:

mySQL Server in a Linux Server,
exe Application in a Windows Station, requiries a libmysql.dll, please:

what version of mySQL server?
what version of libmysql.dll
what version of Delphi and myDAC.

it's probable a incompatible mySQL version and client library version.

run in console Select Version() for retrieve the version of mySQL.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 02 Mar 2006 19:14

Delphi 2005
MyDac 4.00.13
MySQL Server v5.0.18
libmysql.dll version for MySQL 5.0

Muito obrigado Eduardo por passar tempo no meu problema...
(I hope my portugues isn't to bad!)

I don't think it is a version problem. I have other apps using libmysql.dll on this version of MySQL server(5) that I loaded to test the library. They work fine. I haven't found anywhere any demos of MyDAC with MySQL and SSL... so it is difficult to know where the problem comes from. I also have a fair experience with programming and MySQL although I would not think of myself as a guru... however, I have tried all the tricks in the book and can't get the SSL connection to work at all using the MyDAC component...

Cheers
________
Pot News
Last edited by david_labbe on Fri 18 Feb 2011 15:31, edited 1 time in total.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

humm. om

Post by eduardosic » Thu 02 Mar 2006 21:27

david_labbe wrote:Delphi 2005
MyDac 4.00.13
MySQL Server v5.0.18
libmysql.dll version for MySQL 5.0

Muito obrigado Eduardo por passar tempo no meu problema...
(I hope my portugues isn't to bad!)

meu Ingles que é ruim!!
(my English is bad - more ou less)

I don't think it is a version problem. I have other apps using libmysql.dll on this version of MySQL server(5) that I loaded to test the library. They work fine. I haven't found anywhere any demos of MyDAC with MySQL and SSL... so it is difficult to know where the problem comes from. I also have a fair experience with programming and MySQL although I would not think of myself as a guru... however, I have tried all the tricks in the book and can't get the SSL connection to work at all using the MyDAC component...

Cheers

Seu português está muito bom!!
(Its Portuguese is very good!!)

really this is a problem that the CoreLab only goes to be able to help it. please download the lest version of myDAC 4.30.0.10 and test it. . Good Luck.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 03 Mar 2006 10:05

This problem can have following sources:
- Error in MyDAC Direct code. It's most probable. To check it you should connect using Direct = False mode.
- Error in MyDAC code common for Direct and Client modes. It's unlikely as MyDAC common code for SSL is very simple.
- Error in SSL configuration. To check it you should connect to the server using other SSL-client.
- Error in SSL implementation or in MySQL SSL server implementation.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Fri 03 Mar 2006 10:17

Ikar wrote:This problem can have following sources:
- Error in MyDAC Direct code. It's most probable. To check it you should connect using Direct = False mode.
Tried that... see above posts...
- Error in MyDAC code common for Direct and Client modes. It's unlikely as MyDAC common code for SSL is very simple.
...
- Error in SSL configuration. To check it you should connect to the server using other SSL-client.
Just tried that with other clients such as navicat or EngInSite MySQL Client, both supporting SSL connection to mysql. I successfully connected to my DB in both instances.
- Error in SSL implementation or in MySQL SSL server implementation.
MySQL SSL server implementation is robust and works fine (I managed to connect successfully using SSL from external clients). Local implementation of SSL libraries is done using OpenSSL. As far as I am concerned, this was done by the book and works fine
________
SEXUAL DYSFUNCTION FORUMS
Last edited by david_labbe on Fri 18 Feb 2011 15:31, edited 1 time in total.

Post Reply