SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to connect remotely to mysql

    Hi there,

    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?

    thanks
    "Persistence is the path to perfection"

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2005
    Location
    London
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Last edited by jurn; May 14, 2013 at 13:47. Reason: follow up Q

  3. #3
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for that
    "Persistence is the path to perfection"

  4. #4
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    359
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •