[fpc-pascal] remote mysql connection

Wolfram Kläger wolfram.klaeger at web.de
Wed Feb 13 19:20:59 CET 2008

// 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: ...

But then in a second cmd window, telnet 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 instead of remote host.

Admitted, this is no fpc problem. Any hint, anyway?

Thanks in advance
Wolfram Kläger  Wrangellstrasse 11  D-70599 Stuttgart
Tel. (+49) 0711 31 944 39  Fax (+49) 0711 31 944 37

More information about the fpc-pascal mailing list