Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-09

why is there no port property in sqldb?

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bee

One of the most basic paramater for database connection: port, is not provided in sqlDB. While dialect property which is not common outside FB/IB is provided. Is there any particular reason for this? Or should I make a feature request on this?

BTW, how to set port for mysql connection using sqlDB? Defining "port=3307" or "-P 3307" on params property seems to be ignored. Using "hostname:port" on hostname property is also not working. Thanks for the help.

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Reply by email

Marco van de Voort
to Bee
BTW, how to set port for mysql connection using sqlDB? Defining "port=3307" or "-P 3307" on params property seems to be ignored. Using "hostname:port" on hostname property is also not working. Thanks for the help.

If I look in the source, I see a ports parameter, so port=xxx is the way to go.

Could be that in the source it is spelled with a capital P, try "Port=..."

Reply by email

Bee
to Marco van de Voort
Could be that in the source it is spelled with a capital P, try "Port=..."

Nope, still not working. :(

If I look in the source, I see a ports parameter, so port=xxx is the way to go.

Here's why...

{ this is in private section }
procedure TConnectionName.ConnectMySQL(var HMySQL : PMySQL;H,U,P : pchar);
begin
   HMySQL := mysql_init(HMySQL);
   HMySQL:=mysql_real_connect(HMySQL,PChar(H),PChar(U),Pchar(P),Nil,0,Nil,0);
   If (HMySQL=Nil) then
     MySQlError(Nil,SErrServerConnectFailed,Self);
end;

It's obviously there's no way to define custom port. The mysql_real_connect is hardcoded to only use default port (0 for the sixth argument).

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Reply by email

Joost van der Sluis
to Bee

Op zondag 16-09-2007 om 23:29 uur [tijdzone +0700], schreef Bee:

Show quoted text 8 lines
> Could be that in the source it is spelled with a capital P, try "Port=..." Nope, still not working. :( > If I look in the source, I see a ports parameter, so port=xxx is the way to > go. Here's why...

Ah, now I see. Please don't use such an old version, as I told you before. Next time, always mention your version. So we can tell you to test the latest version, before we'll try to help you.

I guess that'll work better for you too.

Joost.

Reply by email

Bee
to Joost van der Sluis
Ah, now I see. Please don't use such an old version, as I told you before. Next time, always mention your version. So we can tell you to test the latest version, before we'll try to help you.

Sorry I forgot to mention the version I used. It is happened on sqldb using tmysql50connection class on FPC 2.0.2, Ubuntu Feisty, mySQL 5.0.

I don't consider 2.0.2 as such an old version since v.2.2 is just released a few days ago. Had sqlDB on FPC 2.2 have port property?

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Reply by email

Joost van der Sluis
to Bee

Op maandag 17-09-2007 om 09:31 uur [tijdzone +0700], schreef Bee:

Show quoted text 6 lines
> Ah, now I see. Please don't use such an old version, as I told you > before. Next time, always mention your version. So we can tell you to > test the latest version, before we'll try to help you. Sorry I forgot to mention the version I used. It is happened on sqldb using tmysql50connection class on FPC 2.0.2, Ubuntu Feisty, mySQL 5.0.

;)

I don't consider 2.0.2 as such an old version since v.2.2 is just released a few days ago. Had sqlDB on FPC 2.2 have port property?

There's also fpc 2.0.4. The version you're using is really old.

For us it's important to know, even if 2.2.0 is brand new, since it saves us time if we don't have to look for a bug which is already fixed in a newer release.

Joost.

Reply by email