0

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.

1
  • You realize that running queries over a SSH tunnel (AKA VPN connection) will impact the speed that queries are sent to MySQL, and how fast they are returned to the webserver? Commented Jan 25, 2010 at 3:34

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

If fsockopen() were to work then a direct connection could just be made instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.