tags:

views:

72

answers:

2

Is it possible to connect to a MySQL database, on remote server, via SSH using PHP that is installed on my local computer?

I am a bit confused on this subject. My shared hosting provider suggests I use programs like MySQL Query Browser and Microsoft SQL Server Management Studio Express.

I have done some research on SSH at php.net (as well as other places) but their manual on the subject is not very helpful.

+2  A: 

Yes. You'll need to set up a SSH tunnel, and connect via TCP/IP.

Ignacio Vazquez-Abrams
A: 

If you are unable to setup a tunnel as mentioned above, you can alternatively execute commands yourself over an open socket. Look into fsockopen.

Matt Dunbar
If fsockopen() were to work then a direct connection could just be made instead.
Ignacio Vazquez-Abrams