Databases
- Change database password
- Create a database
- Database servers management
- Delete a database
- Enable remote access
- Install PostgreSQL
- Remote database servers
- Select MySQL version
- Web database administration
Introduction
On this page
FASTPANEL® allows you to manage two of the most popular database management systems: MySQL and PostgreSQL.
Changing database password
To change the database password click on the user icon in front of the database. On the new page, you will see the list of users that have access to the selected database. Select the user you need to change the password for and click "User management".
On the new page, you will see the list of users that have access to the selected database. Choose the user you need to change the password for and click "Edit".
In the widow that opens, enter and confirm a new password, then click "Save"
Create a database
On this page
FASTPANEL® allows you to manage two of the most popular database management systems: MySQL and PostgreSQL.
Creating a database
Go to the Databases Management menu in the Side Menu → "Databases"
All settings somehow related to the databases and database servers are performed through this menu.
Click "New database" and in the window that opens fill in the following fields:
- Database name
- Server - specifies the database server which is to create a database on
- User (Login) - MySQL user to connect to the database. A new user is created by default, but you can also choose one from existing users
- Owner - the control panel user that has an access to manage the database
- Website - specifies the website which the database will be connected to. If the website is deleted, the connected database will be deleted as well
- Character set - specifies the character set to show the data. UTF-8 is set by default
- Password - password for the MySQL user to connect to the database;
Database servers management
On this page
Introduction
FASTPANEL® can manage local database servers as well as external ones. By default FASTPANEL® comes with a standard set of software, which always includes MySQL server.
If needed, PostgreSQL server can be installed after the FASTPANEL® installation. As soon as PostgreSQL is installed, it will be automatically added to the panel settings.
Additional (external) DBMS servers can be connected using the menu section "Settings" → "Databases"
Click "Database servers"
More detailed information about external database connection you can find here.
Database server settings management
FASTPANEL® allows to edit configuration of local database servers through the panel’s interface. To do this open settings menu → "Databases" → "Database servers" → "Configure variables"
In the window that opens you may configure new values for server parameters or set up new default values:
Database server settings management is only possible for local database servers.
Where can I find the local MySQL server root password?
When MySQL is installed, its root password is stored in /root/.my.cnf file on your server.
The file isn't available from FASTPANEL®. It can only be accessed via SSH or SFTP.
Introduction
On this page
FASTPANEL® allows you to manage two of the most popular database management systems: MySQL and PostgreSQL.
Deleting a database
Deleting a database is performed from the database management menu with the help of the "Delete*" button in the "Actions" section.
Introduction
Initially FASTPANEL® configures MySQL server such way that connections are accepted only from the server itself (localhost). To enable external connections, you must first reconfigure the MySQL server.
Enabling remote connection to the MySQL server
To add the ability to connect to databases remotely you need to configure the bind_adress variable in MySQL variables. You can edit these variables directly from FASTPANEL: management menu → Databases → Database Servers → Configure variables
The bind-address variable, which by default has the value 127.0.0.1, is responsible for allowing the remote connection. You need to change this value using the "Edit" button, setting the value to * and click Save to apply the changes.
After changing the value and clicking the "Save" button there is no need to restart the MySQL service.
You can also use the search to find mysqlx-bind-address, this is the equivalent of the bind_adress variable for the X Plugin. It represents the network address where the X Plugin is listening for TCP/IP connections. This variable is not dynamic and can only be set at startup.
Database user with remote connection
Open management menu → "Databases" → "Editing a database user" and set flag on "Remote connections":
Introduction
On this page
PostgreSQL is not installed by default on the server along with FASTPANEL®.
Install PostgreSQL
After the panel itself is installed, PostgreSQL installation is available from the "Applications" menu.
This section shows the list of available PostgreSQL versions for installation, there you can also install phpPgAdmin:
Remote database servers
Introduction
FASTPANEL® allows to connect external database servers: MySQL or PostgreSQL; thus giving an opportunity to work with databases located on external servers.
External databases cannot be added into backup plans, and settings management is not available for external database servers in FASTPANEL®
This article describes an example of connecting an external DBMS server to the FASTPANEL® on the main server.
Examples in this article use nominal IP 1.1.1.1 as the address of the main server with FASTPANEL® . Real external server address doesn’t matter, but outside of the examples given in this article it has nothing to do with 1.1.1.1
MySQL database server connection
To connect an external MySQL server to FASTPANEL® follow the steps:
-
By executing the following query you will create an external MySQL server user who is granted privileges to allow external connections and databases management. To perform it, you must log in mysql as an administrative user:
CREATE USER 'FASTPANEL_USER'@'FASTPANEL_IP' IDENTIFIED BY 'PASSWORD';- FASTPANEL_USER - the user name which will be used for FASTPANEL® connections to the server
- FASTPANEL_IP - an IP address of the server with FASTPANEL® installed
- PASSWORD - the password which will be used for FASTPANEL® connections to the server
Query example:
-
Grant administrative privileges for the created user by executing the following query
GRANT ALL PRIVILEGES ON *.* TO FASTPANEL_USER@'FASTPANEL_IP' WITH GRANT OPTION;- FASTPANEL_USER - the user name which will be used for FASTPANEL® connections to the server.
- FASTPANEL_IP - is the IP address of the server with FASTPANEL® installed
Query example:
-
Make MySQL listen to all network interfaces. This requires editing or adding the following line into MySQL configuration file (most frequently it is
/etc/mysql/my.cnfbut may vary):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
To finish setup perform the following actions in the FASTPANEL® on the main server
-
Go to "Settings" → "Databases"
-
Click "Database servers"
-
Click "Add a server" button, then uncheck "Local server" checkbox and fill in the fields with the data to connect the external server from the previous steps
If everything is done correctly, a new line with an added server information will appear in the "Database servers" page. After that this server will become available for database creating.
PostgreSQL database server connection
To connect an external PostgreSQL server to FASTPANEL® follow the steps:
-
By executing the following query you will create an external PostgreSQL server user who is granted privileges to allow external connections and databases management. To perform it, you must log in psql as an administrative user:
CREATE USER FASTPANEL_USER WITH ENCRYPTED PASSWORD 'USERPASSWORD' SUPERUSER BYPASSRLS REPLICATION CREATEDB CREATEROLE INHERIT LOGIN;- FASTPANEL_USER - the user name which will be used for FASTPANEL® connections to the server
- USERPASSWORD - the password which will be used for FASTPANEL® connections to the server
Query example:
-
Grant the created user external connections privileges by adding the following lines into postgresql config file
pg_hba.confhost all FASTPANEL_USER 0.0.0.0/0 md5
host all FASTPANEL_USER ::/0 md5File Example:
-
Make PostgreSQL listen to all network interfaces. This requires adding the following line into PostgreSQL configuration file (most frequently it is
/etc/postgresql/VERSION/main/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
To finish the setup, perform the following actions in FASTPANEL® on the main server:
-
Go to "Settings" → "Databases"
-
Click "Database servers"
-
Click "Add a server" button
-
Uncheck "Local server" checkbox and fill in the fields with the data to connect the remote server from the previous steps
If everything is done correctly, a new line with an added server information will appear in the "Database servers" page. After that this server will become available for database creating.
Introduction
MySQL is installed by default on the server along with FASTPANEL®. There is an option to choose a specific MySQL version that will be installed along with the control panel.
Select a MySQL version during FASTPANEL installation
First, prior to FASTPANEL® installation, you need to check which versions are supported by your operating system.
It can be done by executing the following command:
wget https://repo.fastpanel.direct/install_fastpanel.sh && bash install_fastpanel.sh --help | grep 'Available versions'The list of available MySQL versions will appear in the "Available versions" line. Afterward, you can specify the MySQL version or fork. Below is the example of installing FASTPANEL® with MySQL 8.0:
bash install_fastpanel.sh -m mysql8.0Introduction
On this page
FASTPANEL® allows you to install phpMyAdmin and phpPgAdmin to manage databases.
PHPMyAdmin
A web interface for managing MySQL databases. PHPMyAdmin provides convenient management of tables, queries, and users through a web-based interface. PhpMyAdmin is installed by default on the server along with FASTPANEL®.
PHPPgAdmin
A web interface for managing PostgreSQL databases. PHPPgAdmin allows administrators to manage schemas, tables, views, and other PostgreSQL objects through an intuitive web interface. PHPPgAdmin can be installed from the "Applications" menu.
FASTPANEL