I have a simple console program to connect to mysql under linux.
I was using version 4 and it works.
Now I want to use the same programs with mysql5, but I get error connecting: None of the dynamic libraries can be found: libmysqlclient.so
I have made a test program that uses TZConnection and TZQuery, but it can't connect.
So, has anyone successfully connect to mysql5 with these components ??
Suggestions appreciated.
Does anyone successfully connect mysql5 with kylix ?
Moderators: gto, cipto_kh, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi,
What version of ZEOS are you using? Did you modify the ZEOS source?
Looking in the SVN version I notice mysql5 protocol is not included in the Kylix 3 package. So what protocol are you using? Just 'mysql', 'mysql-5',...? If using 'mysql' he tries to take a 'default' protocol (5 in SVN version).
Unfortunately I'm not a Linux user, so I don't know what libraries should be where. Maybe just describe a little what you have put where to test the mysql5 connection, so probably some linux user will see the problem.
Mark
What version of ZEOS are you using? Did you modify the ZEOS source?
Looking in the SVN version I notice mysql5 protocol is not included in the Kylix 3 package. So what protocol are you using? Just 'mysql', 'mysql-5',...? If using 'mysql' he tries to take a 'default' protocol (5 in SVN version).
Unfortunately I'm not a Linux user, so I don't know what libraries should be where. Maybe just describe a little what you have put where to test the mysql5 connection, so probably some linux user will see the problem.
Mark
Hello mdaems,
thats my code for the sample program:
program zeotest;
uses ZConnection, ZDataset;
var
MyConnection: TZConnection;
MyQuery : TZQuery;
sSQL : widestring;
begin
sSQL := 'SHOW TABLES';
MyConnection := TZConnection.Create(nil);
MyQuery := TZQuery.Create(nil);
MyQuery.Connection := MyConnection;
MyConnection.Protocol := 'mysql';
MyConnection.HostName := 'localhost';
MyConnection.Database := 'mydatabase';
MyConnection.User := 'myuser';
MyConnection.Password := 'mypasswd';
MyQuery.SQL.Clear;
MyQuery.SQL.Add(sSQL);
MyQuery.Open;
while not(MyQuery.Eof) do
begin
Writeln(MyQuery.Fields[0].AsString);
MyQuery.Next;
end;
MyQuery.Free;
MyConnection.Free;
end.
As you can see, i'm using 'mysql' protocol.
Any ideas ?
thats my code for the sample program:
program zeotest;
uses ZConnection, ZDataset;
var
MyConnection: TZConnection;
MyQuery : TZQuery;
sSQL : widestring;
begin
sSQL := 'SHOW TABLES';
MyConnection := TZConnection.Create(nil);
MyQuery := TZQuery.Create(nil);
MyQuery.Connection := MyConnection;
MyConnection.Protocol := 'mysql';
MyConnection.HostName := 'localhost';
MyConnection.Database := 'mydatabase';
MyConnection.User := 'myuser';
MyConnection.Password := 'mypasswd';
MyQuery.SQL.Clear;
MyQuery.SQL.Add(sSQL);
MyQuery.Open;
while not(MyQuery.Eof) do
begin
Writeln(MyQuery.Fields[0].AsString);
MyQuery.Next;
end;
MyQuery.Free;
MyConnection.Free;
end.
As you can see, i'm using 'mysql' protocol.
Any ideas ?
Take a look at Lazarus (http://www.lazarus.freepascal.org). I think it might be more stable than Kylix. Using the SVN source, I've been able to use MySQL 5 using Delphi 7. I'm sure it would work fine with Lazarus too.
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi,
Be carefull with Lazarus.
First, you have to use the most recent versions of Lazarus and FPC (even an alpha or beta version I think, see forum). And we don't know yet how to fix the dates problem, unless you've had a look at it. If you know how to update dates using components (not plain sql updates), please let us know. If you didn't look at it yet, please do so, as I think you're one of the more experienced Lazarus users.
Mark
Be carefull with Lazarus.
First, you have to use the most recent versions of Lazarus and FPC (even an alpha or beta version I think, see forum). And we don't know yet how to fix the dates problem, unless you've had a look at it. If you know how to update dates using components (not plain sql updates), please let us know. If you didn't look at it yet, please do so, as I think you're one of the more experienced Lazarus users.
Mark
Jotiwoken,
I use mysql 5.0 commercially with Delphi and Free Pascal. Zeos didn't and still doesn't support Mysql 4.1 or 5.0 natively, plus you can see some of this date issues. For this, using zeos as a starting base, I completely created a new API, closely based on PHP's Data Objects API. It supports Mysql 4.1 and 5.0 native library calls.
Complete documentation can be found here:
https://trac.synsport.com:8000/index.php/pdo
username/password = guest/guest
Like I said, it works perfectly with Free Pascal 2.0+. You don't need lazarus at all. It also works with Delphi 7, and probably earlier and later versions of Delphi as well. I suspect it works in Kylix, but I have never tested that. It has date support although this isn't thoroughly tested.
If you try the code, get it via subversion which is on revision 13. The downloadable zip file is only revision 5 with some since corrected bugs.
Admittedly this is biased: Even if Zeos development wasn't stalled and wasn't buggy and supported mysql 4.1/5.0 better, this Pascal Data Objects API is still better. I chose to start over from scratch for a reason, and I'm really glad I did. I'm several times more productive using PDO than Zeos. I honestly don't know why anyone starting a new project with Mysql and Delphi/FPC/Kylix(?) wouldn't check it out, especially since I'm maintaining the code actively.
Regards,
John
I use mysql 5.0 commercially with Delphi and Free Pascal. Zeos didn't and still doesn't support Mysql 4.1 or 5.0 natively, plus you can see some of this date issues. For this, using zeos as a starting base, I completely created a new API, closely based on PHP's Data Objects API. It supports Mysql 4.1 and 5.0 native library calls.
Complete documentation can be found here:
https://trac.synsport.com:8000/index.php/pdo
username/password = guest/guest
Like I said, it works perfectly with Free Pascal 2.0+. You don't need lazarus at all. It also works with Delphi 7, and probably earlier and later versions of Delphi as well. I suspect it works in Kylix, but I have never tested that. It has date support although this isn't thoroughly tested.
If you try the code, get it via subversion which is on revision 13. The downloadable zip file is only revision 5 with some since corrected bugs.
Admittedly this is biased: Even if Zeos development wasn't stalled and wasn't buggy and supported mysql 4.1/5.0 better, this Pascal Data Objects API is still better. I chose to start over from scratch for a reason, and I'm really glad I did. I'm several times more productive using PDO than Zeos. I honestly don't know why anyone starting a new project with Mysql and Delphi/FPC/Kylix(?) wouldn't check it out, especially since I'm maintaining the code actively.
Regards,
John