Server IP. How to configure?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Wasington Povoa

Server IP. How to configure?

Post by Wasington Povoa » Tue 07 Jun 2005 17:21

To configure the Server parameter in TMyConnection I need the Server IP. My computer has differents Client IP and Server IP (
Mysqladmin shows Client IP. How can I configure the Server IP?

Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Wed 08 Jun 2005 06:35

? Could you be a little bit more explicit ?
Do you have mutliple Network Card on your PC ?

You can works with a Client + MySQL server on the same PC. Just enter the localhost / IP address

Washington Povoa

IP informations

Post by Washington Povoa » Wed 08 Jun 2005 11:33

Only one network card, on a Dell computer.
Server Information: MySQL 4.0.13-nt via TCP/IP; Network Name: localhost; IP:
Client Information: MySQL Client Version 5.0.5; IP:

All servers have default IP I need change the value to permit access differents PCs.


Re: Server IP. How to configure?

Post by RodolfoArias » Wed 08 Jun 2005 19:34

I use this routine en delphi.

function GetIPFromHost (var HostName, IPaddr, WSAErr: string): Boolean;
Name = array[0..100] of Char;
PName = ^Name;
HEnt: pHostEnt;
HName: PName;
WSAData: TWSAData;
i: Integer;
Result := False;
if WSAStartup($0101, WSAData) 0 then begin
WSAErr := 'Winsock no está respondiendo."';
IPaddr := '';
if GetHostName(HName^, SizeOf(Name)) = 0 then begin
HostName := StrPas(HName^);
HEnt := GetHostByName(HName^);
for i := 0 to HEnt^.h_length - 1 do IPaddr := Concat(IPaddr,IntToStr(Ord(HEnt^.h_addr_list^)) + '.');
SetLength(IPaddr, Length(IPaddr) - 1);
Result := True;
else begin
case WSAGetLastError of
end; { GetIPFromHost }

Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Thu 09 Jun 2005 06:40

So you have an Network (as i understood it).
There is no more to do, just "use" the Server Lan IP address.
If your Server IP is then, in each MySQL Client, use '' as the server address.

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

Post by Ikar » Thu 09 Jun 2005 12:34

If MySQL server is located at the same machine with your application then you can set server property to 'localhost'.

Post Reply