Reputation: 29
I seem to be going around in circles never getting this to go.
I have found a mySQL 5.1 32bit that installs and I have made a Schema and table
I also found a ODBC 5.1 connector That I installed.
Found dll's with start button editor - libmysql.dll dbexpmysql.dll dbxopenmysql50.dll myodbc5w.dll
Started Delphi 7 and DB express connector on form
Prams
Host name - Localhost.
Database - site.
Username - root.
Password - admin.
rest is default
I have tried all the above dll's
Error - unable to loadlibmysql.dll or the Dll I have selected in LibaryName.
This is a clean computer basically
What am I doing wrong
I have checked my prams and remembered I set MySQL to localhost - 3306 in my settings as localhost is in google chrome is the ISS start page
This is a standalone computer, am I missing a update some where and if where do I get it from.
I have looked at other databases on my other computer like NoMySQL, oracle but they do not install on my messy computer easily for a standalone DB.
Upvotes: 0
Views: 1201
Reputation: 30745
You might want to take a look at my answer to this q:
how to connect to a MySQL server
It's about getting MySql working with D7 and XE5/6. At the time I wrote it, I was having problems getting MySql to work with any of these Delphi versions. It turned out that the main problem was that I was using too recent a version of the MySql Dlls. I got it working eventually, but took me days and that's why I decided to record the exact method for posterity.
If you follow the exact numbered steps in that answer, I think that there is a pretty good chance that you will end up with a MySql set-up that has at least a chance of working with D7 (note in particular that I had to dig things out of the Archive section of MySql's website).
Update
Below are some extracts from my dbxDrivers.Ini & dbxConnections.Ini and my Delphi test project
dbxDrivers.Ini
[Installed Drivers]
DB2=1
Interbase=1
MySQL=1
Oracle=1
Informix=1
MSSQL=1
OpenMySQL50=1
[OpenMySQL50]
LibraryName=dbxopenmysql50.dll
GetDriverFunc=getSQLDriverMYSQL50
VendorLib=libmysql.dll
HostName=localhost
DataBase=MATestDB
User_Name=SA
Password=password
[...]
dbxConnections.Ini
[OpenMySQL50Connection]
DriverName=OpenMySQL50
HostName=LocalHost
Database=MATestDB
User_Name=sa
Password=password
BlobSize=-1
Code
type
TForm1 = class(TForm)
SQLConnection1: TSQLConnection;
SQLQuery1: TSQLQuery;
DataSetProvider1: TDataSetProvider;
SQLQuery1Table1ID: TIntegerField;
SQLQuery1AName: TStringField;
SQLQuery1AValue: TStringField;
CDS1: TClientDataSet;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
procedure FormCreate(Sender: TObject);
private
procedure OpenConnection;
public
end;
[...]
procedure TForm1.OpenConnection;
begin
SqlConnection1.DriverName := 'OpenMySql50';
SqlConnection1.Params.Append('HostName=localhost');
SqlConnection1.GetDriverFunc := 'getSQLDriverMYSQL50';
SqlConnection1.LibraryName := 'dbxopenmysql50.dll';
SqlConnection1.VendorLib := 'libmysql.dll';
SqlConnection1.Params.Append('Database=MATestDB');
SqlConnection1.Params.Append('User_Name=sa');
SqlConnection1.Params.Append('Password=');
SqlConnection1.Open;
SqlQuery1.Open;
CDS1.Open;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
OpenConnection;
end;
Those are all the relevant details of my D7 project. After posting my earlier answer to the other q, I decided it was easier to have the two dbx .Ini files and the two Dlls in the same directory as my D7 project.
dbxopenmysql50.dll is dated 21 August 2007 and is version 1.3.0.39
libmysql.dll is dated 6 Octber 2006 and is 2,596,864 bytes. There is no embedded version number.
My MySql server is version 5.6.19. Obviously, you need to make sure the server is properly installed and that the MySql Server service is running.
As you can see, it works without involving ODBC.
If you get that far and are still having problems, I suggest you spend some time improving your q as Ken White suggested.
Upvotes: 1