Mydac on OSX not connecting.

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
toolfolks
Posts: 7
Joined: Wed 28 Jan 2015 09:52

Mydac on OSX not connecting.

Post by toolfolks » Wed 28 Jan 2015 10:02

I am testing and can run a simple database app on windows.

I have compiled to OSX and get 'cannot connect to mysql server on XXXX'.

I have install mysql server on the mac (hoping this installed the necessary bits and pieces).

Is there some equivalent of dlls I have to add?

Thanks....

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Mydac on OSX not connecting.

Post by ViktorV » Wed 28 Jan 2015 12:45

If you are using Direct Mode in MyDAC (TMyConnection.Options.Direct property is True), no third-party libraries for connection to MySQL server are needed. The error may be due some restrictions on the PC with installed MySQL server or OSX (antivirus or firewall can block incoming or outgoing connections or ports, incorrect MySQL server configuration, etc.).

toolfolks
Posts: 7
Joined: Wed 28 Jan 2015 09:52

Re: Mydac on OSX not connecting.

Post by toolfolks » Thu 29 Jan 2015 12:07

I am trying to connect to a remote mysql database from a mac not mysql on the local machine.

I installed mysql server in the hope it cured the problem I am having.

The TMyConnection.Options.Direct property is True

I have 3 different macs.
None of them have firewall switched on.
None have antivirus.

I am able to use SequelPro ( mysql database management ) on each machine.

I can connect to all my databases with this okay.

Is there anyway I can trace where its failing?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Mydac on OSX not connecting.

Post by ViktorV » Thu 29 Jan 2015 14:13

Please create an empty project and run the following code:

Code: Select all

var
  con: TMyConnection;
begin
  con := TMyConnection.Create(nil);
  try
    con.Server := Server;
    con.Port := 3306;
    con.Username := User;
    con.Password := Password;
    con.Database := Database;
    con.LoginPrompt := False; 
    con.Open;
    if con.Connected then ShowMessage('Connected!')
  finally
    con.Free;
  end;
Note, that to run this code, you should add the MyAccess unit to the USES clause of your unit.
If you get an error on this code execution, please specify its full message.

toolfolks
Posts: 7
Joined: Wed 28 Jan 2015 09:52

Re: Mydac on OSX not connecting.

Post by toolfolks » Fri 30 Jan 2015 15:03

On windows it connects ok.

On Mac I get cannot connect to MYSQL server on www.mydomain.com (10061).

Thanks.

toolfolks
Posts: 7
Joined: Wed 28 Jan 2015 09:52

Re: Mydac on OSX not connecting.

Post by toolfolks » Fri 30 Jan 2015 15:37

I have just tested on another mac.

It connected okay.

I then quit the app and re-launched and get can't connect.

10061.

Re started the mac and can't connect (10061).

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Mydac on OSX not connecting.

Post by ViktorV » Mon 02 Feb 2015 12:59

To investigate the problem, please execute the following code and let us know the results:

Code: Select all

var
  VioTCP: TCRVioTCP;
begin
  VioTCP := TCRVioTCP.Create;
  try
    VioTCP.Host := Server;
    VioTCP.Port := Port;
    VioTCP.Timeout := 0;
    if VioTCP.TryConnect then
      ShowMessage('OK')
    else
      ShowMessage('Error: ' + VioTCP.LastError+ #$D#$A'Code: ' + 
        IntToStr(VioTCP.LastErrorCode));
  finally
    VioTCP.Free;
  end;
end;
Note, that to run this code, you should add the CRVioTCP unit to the USES clause of your unit.

toolfolks
Posts: 7
Joined: Wed 28 Jan 2015 09:52

Re: Mydac on OSX not connecting.

Post by toolfolks » Thu 12 Feb 2015 10:21

Hi,

On the PC I am getting:

Error: Cannot connect to server on host 'www.wilsea.com':
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Socket Error Code: 10060($274C)
Code: 10060

On Mac I am getting :

Error: Cannot connect to server on host 'www.wilsea.com':
operation timed out.
Socket Error Code: 60($3C)
Code: 60

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Mydac on OSX not connecting.

Post by ViktorV » Thu 12 Feb 2015 11:13

Please check whether you can connect to the host: ensembldb.ensembl.org.

Code: Select all

  VioTCP.Host := 'ensembldb.ensembl.org';
  VioTCP.Port := 3306;

toolfolks
Posts: 7
Joined: Wed 28 Jan 2015 09:52

Re: Mydac on OSX not connecting.

Post by toolfolks » Thu 12 Feb 2015 11:45

Hi,

Same error on PC & mac .

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Mydac on OSX not connecting.

Post by ViktorV » Thu 12 Feb 2015 12:30

Please check whether you can connect to the host ensembldb.ensembl.org using Telnet:

Code: Select all

  telnet.exe ensembldb.ensembl.org 3306

toolfolks
Posts: 7
Joined: Wed 28 Jan 2015 09:52

Re: Mydac on OSX not connecting.

Post by toolfolks » Thu 12 Feb 2015 13:06

On PC I get:

Some garbled text
then Connection to host lost

On Mac I get :

Similar garbled text

then connection closed by foreign host

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Mydac on OSX not connecting.

Post by ViktorV » Fri 13 Feb 2015 13:14

Please check whether you can connect to the host ensembldb.ensembl.org by specifying its IP address:

Code: Select all

 VioTCP.Host := '193.62.203.187';
You have written earlier that you could connect to MySQL server from Windows, now you are writing that you can connect neither to OSX nor to Windows. Maybe there were some changes, for example, in the network configuration.

Post Reply