remote connection to mysql
ALeine
aleine at austrosearch.net
Mon Feb 21 01:52:18 PST 2005
mhersant at comcast.net wrote:
> use DBI;
>
> my $dbh = DBI->connect(
> 'dbi:mysql:database at 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
More information about the freebsd-hackers
mailing list