silversurfer5150 — 2013-05-14T05:48:34-04:00 — #1
Is there any way to connect to a my live database from mysql on a local machine? Can I just use the web address, database name, username and password? What is the mysql syntax for doing this?
jurn — 2013-05-14T16:45:12-04:00 — #2
Normally the live database would not be exposed publicly as this a security risk, and may be hosted on a different machine to your website.
If it is exposed the syntax would be something like:
mysql -u username -p dbserver.example.com dbname
You'll be prompted for the password.
That said.. why do you want to connect from your local?
hosts typically provide a HTML UI to access the database,
or you should ssh in and use the command line client from there.
silversurfer5150 — 2013-05-14T18:08:56-04:00 — #3
Thanks for that
doug_g — 2013-05-14T20:16:31-04:00 — #4
I had a mysql db at a hosting company that allowed remote access, never had any problems. You must open/forward the mysql tcp/ip port (normally 3306} through any routers/firewalls. And in mysql itself you have to allow your remote hosts to access the server, by default remote access is disabled.
Once set up you can use tools like heidi sql, mysql workbench, etc on your remote database.