connecting to MySQL database thru SSH tunnel

Sieg Lindstrom sl at trackandfieldnews.com
Wed Dec 7 17:08:53 EST 2011


I have an app for managing data in a MySQL database on a remote server. It¹s
worked fine for years but now I would like to route the connection thru an
SSH tunnel. It uses a port number other than 3306 (PortNumberHere in the
function example below). So I¹ve changed the relevant function from this...

put 
revOpenDatabase("MySQL","madeuphost.com","myDatabaseName","UserName","myPass
word") into myDB

... which works fine through a normal web connection, to this for the SSH
tunnel version...

put 
revOpenDatabase("MySQL","localhost:PortNumberHere","myDatabaseName","UserNam
e","myPassword") into myDB

That doesn¹t work. I get the following error message.

³Can¹t connect to local MySQL server through socket Œtmp/mysql.sock¹ ²

 I¹m using LiveCode 5.0.1 on Mac OSX. Is there a solution? Some other
parameter I need to specify? I have sqlite sitting in the same directory as
LiveCode. Could that be problematic? Thanks.

Sieg



More information about the use-livecode mailing list