[fpc-pascal] remote mysql connection
Mattias Gaertner
nc-gaertnma at netcologne.de
Wed Feb 13 19:51:09 CET 2008
On Wed, 13 Feb 2008 19:20:59 +0100
Wolfram Kläger <wolfram.klaeger at web.de> wrote:
> // Michael Van Canneyt, 12.02.2008 20:08
> >
> > On Tue, 12 Feb 2008, Wolfram Kläger wrote:
> >
> >> I am trying to get access to a remote MySQL database via sqldb and
> >> mysql50conn, ending up with 'EDatabaseError, Server connect
> >> failed.'
> ...
> > Make sure that
> > a) the mysql server is listening to remote requests.
> > b) the default mysql port is correct.
> > (if not, add a port=xyz line to the Params property)
> > c) the user has permissions to connect to the database
> > d) the server doesn't run a firewall that blocks access.
>
> I tried everything ?!
>
> a) /etc/ssh/sshd_config: AllowTcpForwarding activated
> b) def. port 3306 is ok, Params.Add('port=anyother') as well
> c) several users, excl. root, granted all privileges on mysql command
> line, via PHPmyAdmin, ... everything alright, but SSH only
> d) Plesk 8.1 firewall on server allows SSH, but blocks MySQL ports
>
> Yes, it's a shared server, but instead of creating a CGI workaround,
> as Leonardo proposed, I feel tunnel forwarding would be more
> appropriate. Tried to do so by using the Putty command line tool
>
> plink ... -L 3306:127.0.0.1:3306 ...
Maybe
plink ... -L 3306:server_name:3306 ...
?
> But then in a second cmd window, telnet 127.0.0.1 3306 returns empty,
> and plink says in the first window "forwarded connection refused by
> server ... failed". Same with my .pas application, of course, trying
> to connect to 127.0.0.1 instead of remote host.
>
> Admitted, this is no fpc problem. Any hint, anyway?
Mattias
More information about the fpc-pascal
mailing list