Change the Default MySQL Host

By default, Onpub attempts to connect to a MySQL server running on localhost (127.0.0.1) when you login to the content management interface.

If your MySQL server runs remotely, then perform the steps below to configure Onpub to talk to the remote host.

If your MySQL server is installed on the same machine as Onpub, then the steps below are unecessary.

To change the hostname/IP address of Onpub's default database host, follow the steps below:

  1. Open the file onpubgui.php in the onpub/manage directory 
  2. You will see the following line near the top of the file: define("ONPUBGUI_PDO_HOST", "localhost");
  3. Change "localhost" to the hostname or IP address of the MySQL server you want Onpub to connect to instead

Alternatively, you can comment out the whole line so that it looks like:

//define("ONPUBGUI_PDO_HOST", "localhost");

The above will cause the Onpub login screen to show a Hostname field, which allows you to specify your MySQL server's hostname prior to your login attempt.

Comments

Feel free to comment on this article below. Any abusive/offensive material will be removed without notice.

blog comments powered by Disqus