KNOWNHOST WIKI

User Tools

Site Tools


developmental:configure-mysql-mariadb-postgresql-remote-connections

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developmental:configure-mysql-mariadb-postgresql-remote-connections [2018/08/16 14:55]
Daniel P. created
developmental:configure-mysql-mariadb-postgresql-remote-connections [2019/10/11 12:10] (current)
Karson N.
Line 18: Line 18:
  
  
-{{:​developmental:​accesshosts.png?​direct&​1200|}}+{{:​developmental:​accesshosts.png?​nolink&​1200|}}
  
  
 You can enter the hostnames or IP addresses of the allowed hosts here. You may use a percent sign as a wildcard, so you could add '​192.168.%'​ to this list to allow all IPs that begin with '​192.168'​. ​ Click "​Save"​ when you have added the IP or fully qualified hostname. ​ The following image shows how to permit remote connections for all IPs (not recommended due to security concerns and shown for demonstration purposes only): You can enter the hostnames or IP addresses of the allowed hosts here. You may use a percent sign as a wildcard, so you could add '​192.168.%'​ to this list to allow all IPs that begin with '​192.168'​. ​ Click "​Save"​ when you have added the IP or fully qualified hostname. ​ The following image shows how to permit remote connections for all IPs (not recommended due to security concerns and shown for demonstration purposes only):
  
-{{:​developmental:​allow-all-remoteips.png?​direct&​1200|}}+{{:​developmental:​allow-all-remoteips.png?​nolink&​1200|}}
  
 You will notice at the bottom of this screenshot, the following is stated: You will notice at the bottom of this screenshot, the following is stated:
Line 33: Line 33:
 To add remote access for all cPanel accounts, simply click "click here" in the statement at the bottom of the "​Additional MySQL Access Hosts" page as shown below: To add remote access for all cPanel accounts, simply click "click here" in the statement at the bottom of the "​Additional MySQL Access Hosts" page as shown below:
  
-{{:​developmental:​additionalmysqlhostsclickhere.png?​direct&​1200|}}+{{:​developmental:​additionalmysqlhostsclickhere.png?​nolink&​1200|}}
  
 After clicking the 'click here' option to update the remote access mysql for all cPanel accounts, you will see a confirmation of the users that were updated. On this demonstration server, only two users exist, so only two users were updated: After clicking the 'click here' option to update the remote access mysql for all cPanel accounts, you will see a confirmation of the users that were updated. On this demonstration server, only two users exist, so only two users were updated:
  
-{{:​developmental:​updatedmysqlhostsforall.png?​direct&800|}}+{{:​developmental:​updatedmysqlhostsforall.png?​nolink&800|}}
  
 If we only want to allow access for one cPanel user's databases, then we must log into the cPanel account for that user and add the IP(s)/​FQDN(s) there. We can redirect to the cPanel from within WHM here: If we only want to allow access for one cPanel user's databases, then we must log into the cPanel account for that user and add the IP(s)/​FQDN(s) there. We can redirect to the cPanel from within WHM here:
Line 45: Line 45:
 Locate the cPanel account you need to enter in the table and click the CP icon for that user. This will open a new window for that cPanel account. ​ Locate the cPanel account you need to enter in the table and click the CP icon for that user. This will open a new window for that cPanel account. ​
  
-{{:​developmental:​cpredirecticon.png?​direct&​1200|}}+{{:​developmental:​cpredirecticon.png?​nolink&​1200|}}
  
 Once inside the user's cPanel, navigate as follows: Once inside the user's cPanel, navigate as follows:
Line 51: Line 51:
   cPanel >> Home >> Databases >> Remote MySQL   cPanel >> Home >> Databases >> Remote MySQL
  
-{{:​developmental:​cpanel-remote-mysql.png?​direct&600|}}+{{:​developmental:​cpanel-remote-mysql.png?​nolink&800|}}
  
 This will open the following interface, which shows where to add a new remote MySQL host, and then beneath lists the current hosts that exist already (there may already be one listed and it will be the server'​s main IP): This will open the following interface, which shows where to add a new remote MySQL host, and then beneath lists the current hosts that exist already (there may already be one listed and it will be the server'​s main IP):
  
-{{:​developmental:​remotemysqlcpanel.png?​direct&​1200|}}+{{:​developmental:​remotemysqlcpanel.png?​nolink&​1200|}}
  
  
Line 69: Line 69:
  ​PostgreSQL is a powerful, open source object-relational database system that is known for its ability to scale well. It is configured to listed only on the localhost by default, however, you can simply edit 2 files to specify a remote IP that you'd also like it to listen for connections from. Here are the default settings that are permitting it to only listen on localhost:  ​PostgreSQL is a powerful, open source object-relational database system that is known for its ability to scale well. It is configured to listed only on the localhost by default, however, you can simply edit 2 files to specify a remote IP that you'd also like it to listen for connections from. Here are the default settings that are permitting it to only listen on localhost:
  
-{{:​developmental:​postrgres-default-conf.png?​direct&​1000|}}+{{:​developmental:​postrgres-default-conf.png?​nolink&​1000|}}
  
 We will need to edit these in addition to specifying the remote IP to allow access for in another file. We will need to edit these in addition to specifying the remote IP to allow access for in another file.
Line 89: Line 89:
 You specify ​ md5 if you only want that host to be able to log in using an MD5 encrypted password. Replacing '​md5'​ with '​trust'​ allows them to connect unconditionally without a password. You may not be able to connect using md5 without having first set up password authentication and a database user, which can be done in  cPanel >> Home >> Databases >> PostgreSQL Databases ​ OR in cPanel >> Home >> Databases >> PostgreSQL Database Wizard. ​ The PostgreSQL Database Wizard cPanel inteface will walk you through creating and configuring your Postgres database and user.  You specify ​ md5 if you only want that host to be able to log in using an MD5 encrypted password. Replacing '​md5'​ with '​trust'​ allows them to connect unconditionally without a password. You may not be able to connect using md5 without having first set up password authentication and a database user, which can be done in  cPanel >> Home >> Databases >> PostgreSQL Databases ​ OR in cPanel >> Home >> Databases >> PostgreSQL Database Wizard. ​ The PostgreSQL Database Wizard cPanel inteface will walk you through creating and configuring your Postgres database and user. 
  
-{{:​developmental:​postgresqldbwizard.png?​direct&​1200|}}+{{:​developmental:​postgresqldbwizard.png?​nolink&​1200|}}
  
 Once you are comfortable with this, you can use the cPanel interface Home >> Databases >> PostgreSQL Databases to do this instead. This interface contains all functionality on one page and may be quicker to use.  Once you are comfortable with this, you can use the cPanel interface Home >> Databases >> PostgreSQL Databases to do this instead. This interface contains all functionality on one page and may be quicker to use. 
  
-{{:​developmental:​cpanelinterfacepostgres.png?​direct&​1200|}}+{{:​developmental:​cpanelinterfacepostgres.png?​nolink&​1200|}}
  
  
Line 138: Line 138:
 If you don't get any output from that command, then you will need to add the entry. The image below depicts an ignored Postgres executable: If you don't get any output from that command, then you will need to add the entry. The image below depicts an ignored Postgres executable:
  
-{{:​developmental:​postgrespignore.png?​direct&600|}}+{{:​developmental:​postgrespignore.png?​nolink&800|}}
  
   nano /​etc/​csf/​csf.pignore   nano /​etc/​csf/​csf.pignore
developmental/configure-mysql-mariadb-postgresql-remote-connections.1534431332.txt.gz · Last modified: 2018/08/16 14:55 by Daniel P.