0

I have a website and a windows application that use the same database on a hosting server.
Recently the hosting company disabled remote connection to MySQL from 3rd party applications (such as my windows app).

In this case, how can I connect my application to this database? Is there any way for it?

Ben
  • 51,770
  • 36
  • 127
  • 149
Mohammad Saberi
  • 12,864
  • 27
  • 75
  • 127
  • which hosting provider are you with? Have you tried googling if they offer the feature? For example i'm with a company called Netvirtue and they offer a guide to enable SSH or Mysql Remote access (https://kb.netvirtue.com.au/index.php?action=artikel&cat=3&id=43&artlang=en) – wired00 Jan 01 '14 at 21:59

2 Answers2

0

You could make some kind of API through your web site. Or perhaps tunneling will work, but if your hoster does not want other apps to connect, I reckon tunneling is also out of the question.

Bart Friederichs
  • 33,050
  • 15
  • 95
  • 195
  • They told me I have to create an intermediate PHP script for it. But I could not understand what they are talking about exactly. – Mohammad Saberi Jan 01 '14 at 19:09
0

If you have SSH available, you may be able to use an SSH tunnel. This solution is best for interactive use; you'll have to create the tunnel each time you want to use the application.

Using OpenSSH on the command line:

ssh you@webhost -L 3306:localhost:3306

Using the graphical SSH client PuTTY, you can go to this node in the settings:

  • Connection
    • SSH
      • Tunnels

And add a forward by filling 3306 in the "Source port", and localhost:3306 in the "Destination", then clicking the "Add" button.

Now you should be able to connect your application to localhost:3306 and the connection will be passed through to webhost:3306.

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257