MaestroS
User
 Fresh Boarder
| Posts: 7 |   | Karma: 0 |
|
Connection to remote host
|
|
Posted: 2007/08/08 13:31 |
|
|
|
|
Look. That's how I'm trying to login into MySQL server:
if (aledit1.Text <> '') and (aledit2.Text <> '') and (aledit4.Text <> '') then begin
adconnection1.Params.Add('DriverID=MySQL');
try
if checkbox1.Checked = true then begin
if (aledit3.Text <>'') then begin
if aledit4.Enabled = true then begin
if aledit4.Text <> '' then begin
adconnection1.Params.Add('Database='+aledit4.text);
end else begin
showmessage('If you want to use default database, please fill in correct field...');
end;
end;
adconnection1.Params.Add('User_Name='+aledit2.text);
adconnection1.Params.Add('Password='+aledit3.text);
adconnection1.Params.Add('Host='+aledit1.text);
adconnection1.Connected := true;
end else begin
ShowMessage('If connection requires password, you must fill in "Database password" field correctly.');
end;
end else begin
if aledit4.Enabled = true then begin
if aledit4.Text <> '' then begin
adconnection1.Params.Add('Database='+aledit4.text);
end else begin
showmessage('If you want to use default database, please fill in correct field...');
end;
end;
adconnection1.Params.Add('User_Name='+aledit2.text);
adconnection1.Params.Add('Host='+aledit1.text);
adconnection1.Connected := true;
end;
except
on Exception do
statusbar1.Panels[0].text := 'Connection failed...';
end;
end else begin
ShowMessage('One of required field is empty...');
end;
|
But when I put host different than LOCALHOST, it won't connect...
It's only connecting to my LOCALHOST MySQL.
When I'm trying to put host different than LOCALHOST (with username, password and database) it says that connection failed for "root@localhost" WHEN I put:
host: idlesoft.org
user: xxxx
pass: xxx
etc.
What's going on ?
|
|