Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Connection to remote host
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 ?
Re:Connection to remote host
Posted: 2007/08/09 01:11
 
Hello Maestro (or whatever your name is),

are you sure to be allowed for login at idlesoft.org as MySQL user?

At the other side, you add some parameter lines to TADConnection. Make sure that the parameters list is empty before that by calling

 adconnection1.Params.Clear();

Maybe there is a line like 'Host=localhost' present in the list before you add 'Host=idlesoft.org'.
Set breakpoint at adconnection1.Connected := True to see what's in the list.

Regards
Knut

Post edited by: knulo, at: 2007/08/09 01:13
Re:Connection to remote host
Posted: 2007/08/09 01:47
 
Two questions additionally to knulo hints:
1) What is exact error message text, which you receives ?
2) What are version of your MySQL server and libmysql.dll ?