Jump to content

How can I connect to website's mysql from local PC ?


naruponk

Recommended Posts

On shared hosting there is probably no chance they will allow this.

 

I am glad I have an awesome shared host then, because I can do it with my host :)

 

Command line (putty or putty equivalent):

mysql -h myser.myhost.com -u myusername --password=mypassword mydatabase

 

-h: can either be domain, ip, or localhost

-u: your mysql username

--password=: yoru mysql password

mydatabase is the default database to log into, this is optional

 

if you don't know the -h parameter, contact your host.

Link to comment
Share on other sites

What does showing the mysql command line client help prove?  Of course the command line client has the ability to connect to other servers built in.  That doesn't mean that you can be on your local linux box and connect to the instance of mysql on a shared host.  Usually when people request this it is not to use the mysql command line client, but rather to use a gui tool like sqlyog or mysql's tool.

 

The mysql well known port is 3306.  Very few shared hosting companies want to leave this open as it invites hacking attempts.  The user credentials also need to specify the host.  Most panels constrain the user to 'username@localhost'.  In order to allow a connection from other hosts, that needs to be changed to either a wildcard or an ip or ip with wildcard, which is also a gaping invitation for exploiters.  For this reason very few shared hosts do it.  If in fact you have been able to connect from a different machine to your shared host, that is unusual, but I'm not sure for the reasons I stated, it actually indicates that they are "awesome".

 

 

Link to comment
Share on other sites

I do have dreamhost, and I have a shared server and a vps web server (not mysql).

 

all my databases are on the shared server.

 

I can also setup what ip's can connect from the remote address.

 

I also have to set up a host, they don't allow you to use localhost.

 

example:

db.mysite.com

Link to comment
Share on other sites

It sounds to me like the "shared" server in this case is actually specifically a "mysql" server.  That is understandable and would require the ability for different hosts to access it as clients.  Most typical shared hosts have a bunch of machines and they have a shared lamp stack and a mysql that sits on each server. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.