Skip to main content

Database management

Introduction

FASTPANEL® allows you to manage two of the most popular database management systems: MySQL and PostgreSQL.

This article covers the following points:

How to select a MySQL version during FASTPANEL installation?

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. 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 http://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 5.7:

bash install_fastpanel.sh -m mysql5.7

How to install PostgreSQL.

PostgreSQL is not installed by default on the server along with FASTPANEL®. After the panel itself is installed, PostgreSQL installation is available from the "Applications" menu.

Applications menu in FASTPANEL

This section shows the list of available PostgreSQL versions for installation, there you can also install phpPgAdmin:

Install PostgreSQL in FASTPANEL

Databases management

To get to the Databases Management menu open the Side Menu"Databases"

Database management menu in FASTPANEL

All settings somehow related to the databases and database servers are performed through this menu.

How to create a database?

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;

Create a MySQL database in FASTPANEL

How to change 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".

Database user management in FASTPANEL

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".

Edit database user in FASTPANEL

In the widow that opens, enter and confirm a new password, then click "Save"

Change database password in FASTPANEL

How to enable remote access?

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 menuDatabasesDatabase ServersConfigure variables

Database servers management in FASTPANEL

Edit database server settings in FASTPANEL

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 0.0.0.0 and click Save to apply the changes.

Edit mysql variable bind-address in FASTPANEL

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":

Enable database remote connections in FASTPANEL

How to delete a database?

Deleting a database is performed from the database management menu with the help of the "Delete*" button in the "Actions" section.

Delete a database in FASTPANEL

phpMyAdmin and phpPgAdmin

FASTPANEL® allows you to install phpMyAdmin and phpPgAdmin to manage databases. This software has a web-interface to administrate databases where you can see the structure and contents of the database and also run an SQL query. PhpMyAdmin is installed by default on the server along with FASTPANEL®. While phpPgAdmin can be installed from the "Applications" menu.