Thread: MySQL Tunnel

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    3
    Rep Power
    0

    MySQL Tunnel


    My host only accepts localhost connection. I'm looking for a simple free/cheap tunneling solution. I don't believe SSH is an option either. What would you recommend? Thanks.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Why is SSH not an option?

    Are you using MySql or MsSql?
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,204
    Rep Power
    4279
    thread moved to mysql forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    3
    Rep Power
    0
    Originally Posted by E-Oreo
    Why is SSH not an option?

    Are you using MySql or MsSql?
    To be honest, i'm not sure it isn't. Looking through the MySQL properties page on my host, I thought I saw 'SSH -> No' or something. Also, I don't know a lot about it, but I need to deploy this to users in my company. I'm developing in C#, the examples I have looked at have an interface. I need to seamlessly connect. Would SSH work for this? Thanks.
  8. #5
  9. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Looking through the MySQL properties page on my host, I thought I saw 'SSH -> No' or something.
    SSH and MySQL are totally separate, there is no integration between them. MySQL has no built in tunnel capability, it doesn't really make sense for it to because you can just configure it to accept remote connections directly.

    My host only accepts localhost connection.
    If you don't have the ability to change this on your server then it's not likely that you'll have the ability to set up a new tunneling solution either, so you would have to go with one already provided by your host.

    There are security advantages to connecting over a tunnel instead of directly connecting remotely though.

    I'm developing in C#, the examples I have looked at have an interface. I need to seamlessly connect. Would SSH work for this?
    I don't really have any idea on that, you would have to ask someone who programs in C#. To use SSH, you need to install an SSH server (program) on the MySQL server (hardware) (assuming it doesn't already have one). Port forwarding also has to be enabled in the SSH server config, but I believe most Linux variants have this turned on by default. On the client side you then have to open an SSH connection with port forwarding turned on for your MySQL port. On Windows this would normally be done using a client like Putty. Theoretically your C# could do it instead, but you would need to find libraries for doing this, because rolling your own low level code for it would take forever. Your C# also might be able to invoke a third party binary to establish the connection instead. Once the tunnel is established, you could connect through it from your C# code just like you would connect to a normal MySQL server.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo