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?
Server IP. How to configure?
-
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
IP informations
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.
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?
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 }
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 }
-
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59