Page 1 of 1
Server IP. How to configure?
Posted: Tue 07 Jun 2005 17:21
by Wasington Povoa
To configure the Server parameter in TMyConnection I need the Server IP. My computer has differents Client IP and Server IP (127.0.0.1).
Mysqladmin shows Client IP. How can I configure the Server IP?
Posted: Wed 08 Jun 2005 06:35
by swierzbicki
? 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 / 127.0.0.1 IP address
IP informations
Posted: Wed 08 Jun 2005 11:33
by Washington Povoa
Only one network card, on a Dell computer.
Server Information: MySQL 4.0.13-nt via TCP/IP; Network Name: localhost; IP: 127.0.0.1
Client Information: MySQL Client Version 5.0.5; IP:192.168.7.106
All servers have default IP 127.0.0.1. I need change the value to permit access differents PCs.
Re: Server IP. How to configure?
Posted: Wed 08 Jun 2005 19:34
by RodolfoArias
I use this routine en delphi.
function GetIPFromHost (var HostName, IPaddr, WSAErr: string): Boolean;
type
Name = array[0..100] of Char;
PName = ^Name;
var
HEnt: pHostEnt;
HName: PName;
WSAData: TWSAData;
i: Integer;
begin
Result := False;
if WSAStartup($0101, WSAData) 0 then begin
WSAErr := 'Winsock no está respondiendo."';
Exit;
end;
IPaddr := '';
New(HName);
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;
end
else begin
case WSAGetLastError of
WSANOTINITIALISED:WSAErr:='WSANotInitialised';
WSAENETDOWN :WSAErr:='WSAENetDown';
WSAEINPROGRESS :WSAErr:='WSAEInProgress';
end;
end;
Dispose(HName);
WSACleanup;
end; { GetIPFromHost }
Posted: Thu 09 Jun 2005 06:40
by swierzbicki
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 192.168.7.1 then, in each MySQL Client, use '192.168.7.1' as the server address.
Posted: Thu 09 Jun 2005 12:34
by Ikar
If MySQL server is located at the same machine with your application then you can set server property to 'localhost'.