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?
- How to install PostgreSQL?
- Databases management
- Enabling remote access
- phpMyAdmin and phpPgAdmin
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.
This section shows the list of available PostgreSQL versions for installation, there you can also install phpPgAdmin:
Databases management
To get to the Databases Management menu open the Side Menu → "Databases"
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;
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".
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"
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 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 0.0.0.0
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":
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.
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.