am trying to connect to a remote mysql database. i can successfully connect to a local MAMP hosted database. but in order to get around the security on my remote database, I need to connect using SSH. I am using this code:
put "earthednet.org:22" into tDatabaseAddress
put "prothero_livecodetest" into tDatabaseName
put "prothero_live" into tDatabaseUser
put "xxxx" into tDatabasePassword
put 3306 into tSocket
put revOpenDatabase("mysql", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword,true,tSocket) into tResult
--test for errors: if tResult not an integer, answer tResult
When I test for tResult, I get:
"Unable to connect to the database: Lost connection to MySQL server at 'reading initial communication packet', system error: 0.
I can also get the error, as I mess with the variables:
"Unable to connect to the database: host "ip68-... etc" is not allowed to connect to this MySQL server."
I have other applications that can connect to this database through ah SSH tunnel. However, the documentation on how to actually format the revOpenDatabase command is vague.
As I understand it, I need to access the ssh port, which is port 22, and in the tSocket variable, put my mySQL port number, which is 3306. Anyway, these are the correct port numbers and I can access the db with my other application that uses ssh tunneling, so:
thanks for any help.
Trouble connecting to remote mysql
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 38
- Joined: Tue Sep 20, 2011 5:01 pm
- Contact:
Trouble connecting to remote mysql
Bill Prothero
-
- Posts: 38
- Joined: Tue Sep 20, 2011 5:01 pm
- Contact:
Re: Trouble connecting to remote mysql
I can see now, after reflection, that I have tried to use the SSL protocol, but trying to connect using SSH. So, my question has morphed into:
Can I use an SSH connection to access a remote mySQL database? This requires specifying both the SSH port (22) and the remote host's mySQL port, which is 3306. I can connect to a local mySQL database directly (no SSH), but setting up permission for a database to be accessed directly, anywhere isn't secure.
Can I use an SSH connection to access a remote mySQL database? This requires specifying both the SSH port (22) and the remote host's mySQL port, which is 3306. I can connect to a local mySQL database directly (no SSH), but setting up permission for a database to be accessed directly, anywhere isn't secure.
Bill Prothero
-
- Posts: 38
- Joined: Tue Sep 20, 2011 5:01 pm
- Contact:
Re: Trouble connecting to remote mysql
Ignore this. I'm working on ways to go through a server resident cgi, which seems much more secure.
Bill Prothero