Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Feb 2005 05:56:47 -0800 (PST)
From:      "ALeine" <aleine@austrosearch.net>
To:        mhersant@comcast.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: remote connection to mysql 
Message-ID:  <200502201356.j1KDul36034495@marlena.vvi.at>

next in thread | raw e-mail | index | archive | help
mhersant@comcast.net wrote: 

> use DBI;
> 
> my $dbh = DBI->connect(
>	'dbi:mysql:database@host.org:3306',
>	 'user', 'passwd', {
>	 RaiseError => 1, AutoCommit => 1
>    }
> );
> 
> Yet I continue to receive connection errors.	Can't connect to
> the MySQL server on 3306 (10061).  I'v verified that the server is
> listening on  the port.  I also found some info on google about
> Perl DBD::mysql problems.  I tried resetting the user's password
> with the OLD_PASSWORD option.  Nothing works.  Can anyone help???

Error code 10061 = connection refused. Are you sure there is no firewall
in place blocking access to port 3306? Can you telnet to host.org 3306?
If so, you might want to try changing your script like this:

use DBI;

my $dbh = DBI->connect(      
          'dbi:mysql:database=<DATABASE>;host=<REMOTE_IP>;port=3306',
          'user', 'passwd', { RaiseError => 1, AutoCommit => 1 }
);

Otherwise if you are running 4.10 you might want to use sysctl to set
net.inet.ip.portrange.randomized to 0.

Use may also want to use sockstat to make sure your script is actually
trying to connect to the right IP.

ALeine
___________________________________________________________________
WebMail FREE http://mail.austrosearch.net 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502201356.j1KDul36034495>