Link to home
Create AccountLog in
Avatar of Dmon443
Dmon443

asked on

MySQL database connection issue

Hi I am getting an error when I try to connect to a database in MySQL 5.2.46 from Delphi 2010. cannot load libmysql.dll (error code 126), first of all I downloaded libmysql.dll from and added it to C:\Program Files\MySQL\MySQL Server 5.6\bin then to C:\windows\system32, same error then I found the libmysql file in C:\Program Files\MySQL\MySQL Server 5.6\lib which I then copied and replaced the file in system32 still same error. Also tried pointing Vendorlib in delphi to C:\Program Files\MySQL\MySQL Server 5.6\lib\libmysql.dll. Please help
Avatar of Abhishek Chakravarty
Abhishek Chakravarty
Flag of India image

Place libmySQL.dll on the same folder where you’re saving your delphi-mysql project. then from the dbExpress template pick the SQLConnection Component and drop it on the main project form.
set the connection for the component and there you go.

Hope this helps. I have worked on this couple of years ago

Abhishek
Avatar of Dmon443
Dmon443

ASKER

Same error, I'm changing the path on Vendorlib in Delphi, tried with both libmysql.dll files both with same error. I save my delphi projects in a dropbox folder.
Avatar of jimyX
Better off using Direct Access components such as MyDAC.
Avatar of Dmon443

ASKER

I downloaded Direct Access components but I can only find a 30 day trial, is there a free alternative to that?
ASKER CERTIFIED SOLUTION
Avatar of Dmon443
Dmon443

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Dmon443

ASKER

solved database connection problem