Excel to MySQl but host won't support remote addresses
I have an working Excel file, with file I can send data extracted from an drawing program to an remote MySQL server. Since last week my host has canceled the option to send data from an remote host to the MySQL database, now it's only possible to do it from localhost.
Is开发者_运维问答 there any way to get around this problem?
Is there any way to get around this problem?
I doubt it. Barring SSH access and the right to run programs there (which I doubt you have on shared hosting) the only way around this would be by building a PHP "relay", but that can't work with a client trying to establish a low-level mySQL connection.
Unless they agree to making an exception for you, you may have to change hosting providers.
Leave the question open for a while in case someone has an idea, but I don't think there is a workaround.
I don't think you have given enough information to give us some room to work with.
Solution One:
However I'm assuming your remote MySQL server is on Linux with SSH access.
In which case you can create a tunnel to your remote MySQL via SSH.
ssh -f -i /home/Muiter/.ssh/id_rsa username@remote.host.com -L 53306:remote.host.com:3306 -N
As you can see I'm using id_rsa here so it doesn't prompt me for password when I log in to SSH. I tunnel when my linuxbox starts, otherwise you can remove that part and type in password every time.
Now when you are accessing your remote MySQL don't actually use remote host name. Instead its localhost with port 53306.
Solution Two:
If you do not have connection via SSH to remote desktop as mentioned above you might need to create some sort of PHP "relay".
Solution Three:
Another option would be to simply use phpMyAdmin - running on remoteHost (or on a host that has connection to specific MySQL) and just export your excel with phpMyAdmin.
I hope that helps.
精彩评论