MySQL on 2nd server - Html on 1st Server -- how do I configure them to talk to one another?

Posted on 2011-04-21
Last Modified: 2012-05-11
Running mysql on solaris 11, trying to configure MySQL. to allow access from the outside.

How do I setup the server to allow remote connections to the MySQL database.   We are hosting the website on 1 server and the MySQL server is on our machine at a remote location. I've only have done the same machine for both before.    

Can someone help me try to figure out how to get them to talk together from 2 separate locations?

Question by:OQROCK
    LVL 38

    Expert Comment

    by:Aaron Tomosky
    You need the ip of server2. The port needs to be forwarded through the firewall.
    LVL 24

    Expert Comment

    Make sure the Mysql port (usually 3306) is open on the MySQL server.  Try the following

    telnet mysql_server_hostname 3306

    If you get a connection refused or a time-out, something is blocking the connection attempt.

    Once you have that addressed, you just grant permissions to a remote user.  Suggest this user just be used by the website application only, not by anything else:

    grant SELECT,INSERT,UPDATE,DELETE on database_name.* to username@web_server_hostname_or_ip identified by 'password';

    Alternatively, you can just grant to specific tables by replacing * to a table name.  Repeat for each table.

    See for more info.

    Accepted Solution

    problem was solved by keeping both database and webserver on the same machine.  didn't find a workaround.

    Author Closing Comment

    LVL 24

    Expert Comment

    Well, I can't help if the author doesn't even give feedback re what happened when the solution I suggested was tried.  The described requirement, while far less than ideal (you should really have the app and db on the same network for optimum performance),  is nothing new.  Anyway, I won't object to this question being closed if the author doesn't want to discuss further.  Good luck.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I have been using r1soft Continuous Data Protection ( for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
    Creating and Managing Databases with phpMyAdmin in cPanel.
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
    This video discusses moving either the default database or any database to a new volume.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now