Skip to main content

Connecting PHP Web Server to MySQL database server

Comments

4 comments

  • GOT
    You don't really NEED cpanel installed on the database server if all it is ever going to do is host databases, you can simply install your preferred version of MySQL on there and you can even have cPanel on the web server connect to it as an external database server using the Manage MySQL Profiles. If they are in the same rack, if possible I would use a private network connection between them instead of using the public interface.
    0
  • BHPR26
    Any instruction on how to setup a private network connection? Thank you so much for your help!
    0
  • GOT
    You would need to have two nice in the servers minimum and either a crossover cable installed between them or a separate switch set up to handle the private network
    0
  • cPanelMichael
    Hello @BHPR26, Additionally, if it's just a single application that you want to use a remote MySQL database with, then you should not use WHM >> Manage MySQL Profiles to enable the remote MySQL server. That option is intended for administrators that want to store all of their MySQL databases on a remote server. If you only want to host an individual MySQL database on a remote server, you'd simply setup the database on the remote server and use the remote server's IP address as the database host name in your PHP script's configuration file. Then, browse to cPanel >> Remote MySQL and add the MySQL server's IP address as an access host. Thank you.
    0

Please sign in to leave a comment.