Remote database servers

MySQL database server.

 

In order to connect an external MySQL database into FASTPANEL the following are required to follow:

 

1. By executing the following MySQL query you will create a user who is granted privileges to allow external connections and databases management.

 

#FASTPANEL_IPhas to be changed to FASTPANEL IP address

#PASSWORDhas to be changed to an automatically generated one which will be used for connections.

#FASTPANEL_USERhas to be changed to the name of a user you are creating.

 

CREATE USER 'FASTPANEL_USER'@'FASTPANEL_IP' IDENTIFIED BY 'PASSWORD';

 

2. Grant administrative privileges for the created user by executing the following query:

 

#FASTPANEL_IP - has to be changed to FASTPANEL IP address

#FASTPANEL_USER - has to be changed to the name of a user you are creating.

 

GRANT ALL PRIVILEGES ON *.* TO FASTPANEL_USER@'FASTPANEL_IP' WITH GRANT OPTION;

 

3. Make MySQL listen to all network interfaces.

This requires adding the following line into MySQL configuration file (most frequently it is "/etc/mysql/my.cnf"):

 

bind_address = *

To enable new settings MySQL requires restarting. For systemd-type systems it can be achieved by executing the following command:

 

systemctl restart mysql

 

4. To finish setup add the configured connection in the control panel.

  • Go to «Databases» → «Database servers».
  • Click «Add» button and then uncheck «Local server» checkbox and fill the fields with the data from the previous steps.

 

PostgreSQL database server.

 

To connect an external PostgreSQL server to FASTPANEL do the following steps:

 

1. By executing the following query you will create a user who is granted privileges to allow external connections and databases management.

 

#FASTPANEL_USER - has to be changed to the name of a user you are creating.

#USERPASSWORD - has to be changed to an automatically generated one

 

CREATE USER FASTPANEL_USER WITH ENCRYPTED PASSWORD 'USERPASSOWORD' SUPERUSER BYPASSRLS REPLICATION CREATEDB CREATEROLE INHERIT LOGIN;

 

2. Grant user external connections privileges. Add the following lines into pg_hba.conf:

 

host all fastpanel_remote 0.0.0.0/0 md5
host all fastpanel_remote ::/0 md5


3. Make PostgreSQL listen to all network interfaces.

This requires adding the following line into PostgreSQL configuration file (most frequently it is "postgresql.conf"):

 

listen_addresses = '*'

PostgreSQL requires restarting to enable settings. In systemd-type systems it can be done by executing the following command:

 

systemctl restart postgresql

4. To finish setup add the configured connection in the control panel.

  • Go to «Databases» → «Database servers».
  • Click «Add» button and then uncheck «Local server» checkbox, switch «Server type» to 'postgresql' and fill the fields with the data from the previous steps.

Note: External databases can not be added into backup plans and settings management is not available for external database servers

 

This site uses cookie to collect data about IP-address and geolocation in order to provide the most accurate data regarding your request. By continuing to use this web-site you automatically agree with using these technologies.