I have XAMPP on my local machine and am able to run PHP scripts without any issue and connect to my localhost mysql DB flawlessly.
I am interested in pulling data from a live MySQL DB (hosted elsewhere online with Media Temple) with my local script. There are certain aspects of our code we do not want to publish to a web directory for possible security purposes. Is this possible?
Note: To access this database locally with desktop software (like Navicat) requires use of SSH Tunneling of course. We do not allow direct root access to our DB.
If you have to go through an SSH tunnel, this may be difficult. There are some previous questions on the topic, start here. You can set up an SSH tunnel in PHP which may be able to host the connection. Try starting here.
Note that, if you establish an SSH tunnel with each DB request, you’re going to incur a lot of overhead. Keeping that SSH tunnel as persistent as possible is going to be important, but even then there’s likely going to be some noticeable overhead.