MySQL is a database management system used for storing and processing structured data. In a DBaaS environment, you get a managed database cluster without the need for manual configuration: everything is handled automatically.
When creating a cluster, you can choose the MySQL version: 8.0 or 8.4.
When you create a new cluster, a database named default_db is created automatically.
You can create additional databases:
Go to the Databases section of your Hostman control panel.
Click on the cluster.
In the Databases tab, click Add.
Provide a name for your database: 3–64 characters. Letters, numbers, and special characters are allowed.
Add a description, if necessary.
Click Create.
In your control panel, you can manage PostgreSQL users and their privileges.
Go to the Databases section and click on the cluster.
Open the Users tab and click Add.
Set the username and password:
Username: 3–32 characters. Letters, numbers, and special characters are allowed.
Password: 8–30 characters. Letters, numbers, and special characters are allowed.
(Optional) Configure the user’s privileges. You can also leave the default parameters and change them later at any time.
Click Create.
To update the privileges of an existing user:
Go to the Databases section and click on the cluster.
Open the Users tab.
Click the three dots next to the user.
Select Privileges.
Choose the required privileges. You can grant access to a specific database or grant the same privileges for all databases by enabling Identical for all databases in the top right.
Privilege |
Description |
|
Basic privilege that allows login without access to objects. |
|
Read data from tables and views. |
|
Add new records. |
|
Modify existing records. |
|
Remove records. |
|
Create new tables, indexes, and other objects. |
|
Remove objects such as tables or databases. |
|
Use foreign keys. |
|
Create and drop indexes. |
|
Modify the structure of existing tables. |
|
Use manual table locking. |
|
Create views. |
|
Display the structure of existing views. |
|
Create stored procedures and functions. |
|
Modify stored procedures and functions. |
|
Create and manage events ( |
|
Create and drop triggers. |
|
Read access to the system slow query log table. |
|
Ability to clear the contents of the |
You can change the user password:
You can change database settings to optimize its performance.
By default, the database is created with the parameters that are suitable for most tasks and will ensure the performance of the selected configuration. However, if your project requires specific settings, you can change them as you wish.
Be careful and change parameters only if you are sure of their purpose. Incorrect configuration can negatively affect the operation of the database and its performance.
Go to the Databases section and click on the cluster.
Go to the Configuration tab.
Click Modify parameters next to Database parameters.
Adjust the parameters. To read more about each parameter, click Open description next to it.
Click Apply at the bottom of the page.
Available parameters depend on the selected MySQL version.
Parameter |
Valid Values |
Default Value |
1–65535 |
1 |
|
1–65535 |
1 |
|
100–4294967295 |
1500 |
|
1–32 |
4 |
|
1–64 |
4 |
|
0–1000 |
0 |
|
1–64 |
4 |
|
4194304–274877906944 |
214748365 |
|
128–18446744073709551488 |
67108864 |
|
1024–1073741824 |
16777216 |
|
16384–18446744073709550592 |
16777216 |
|
1–100000 |
49 |
|
See documentation |
— |
|
32768–18446744073709551615 |
14680064 |
|
0–16384 |
128 |
|
0–2 |
1 |
|
— |
read-uncommitted |
|
0–31536000 |
10 |
|
1024–18446744073709551615 |
16777216 |
|
1–524288 |
4970 |
|
1–64 |
16 |
|
— |
O_DSYNC |
|
On/Off |
On |
|
On/Off |
On |
|
4096–18446744073709547520 |
32768 |
|
1–1000000 |
1 |
|
— |
full |
|
On/Off |
Off |
|
— |
utf8 |
|
On/Off |
On |
|
4–18446744073709551615 |
1024 |
|
On/Off |
On |
|
1–1073741824 |
50 |
|
On/Off |
Off |
|
1–31536000 |
30 |
|
1–31536000 |
1 |
|
0–2147483647 |
32 |
|
0–4294967295 |
1 |
|
400–524288 |
2000 |
|
On/Off |
On |
|
On/Off |
Off |
|
5242880–18446744073709551615 |
858993459 |
|
1–31536000 |
28800 |
|
1–31536000 |
28800 |
|
-13:59–+14:00 |
— |
Parameter |
Valid Values |
Default Value |
1–65535 |
1 |
|
1–65535 |
1 |
|
100–4294967295 |
1500 |
|
1–32 |
4 |
|
1–64 |
4 |
|
0–1000 |
0 |
|
1–64 |
4 |
|
4194304–274877906944 |
214748365 |
|
128–18446744073709551488 |
67108864 |
|
1024–1073741824 |
16777216 |
|
16384–18446744073709550592 |
16777216 |
|
1–100000 |
49 |
|
See documentation |
— |
|
32768–18446744073709551615 |
14680064 |
|
0–16384 |
128 |
|
0–2 |
1 |
|
— |
read-uncommitted |
|
0–31536000 |
10 |
|
1024–18446744073709551615 |
16777216 |
|
1–524288 |
4970 |
|
1–64 |
16 |
|
— |
O_DSYNC |
|
On/Off |
On |
|
On/Off |
On |
|
4096–18446744073709547520 |
32768 |
|
1–1000000 |
1 |
|
— |
full |
|
On/Off |
Off |
|
— |
utf8 |
|
On/Off |
On |
|
4–18446744073709551615 |
1024 |
|
On/Off |
On |
|
1–1073741824 |
50 |
|
On/Off |
Off |
|
1–31536000 |
30 |
|
1–31536000 |
1 |
|
0–2147483647 |
32 |
|
0–4294967295 |
1 |
|
400–524288 |
2000 |
|
On/Off |
On |
|
On/Off |
Off |
|
8388608–137438953472 |
104857600 |
|
5242880–18446744073709551615 |
858993459 |
|
1–31536000 |
28800 |
|
1–31536000 |
28800 |
|
-13:59–+14:00 |
— |
You can easily restore the default parameters:
Go to the Databases section and click on the cluster.
Go to the Configuration tab.
Click Modify parameters next to Database parameters.
Scroll down to the bottom of the page and click Restore default settings.
Be careful: the parameters will be reset immediately, without additional confirmation.
You can connect to your databases using a web interface or a terminal. Connecting via a web interface is possible only if the cluster has a public IP address.
You can connect to the database via the built-in web interfaces: Adminer or phpMyAdmin.
Go to the Databases section and click on the cluster.
Дlick the Web Interface button and select the preferred option.
Install the MySQL client:
sudo apt install mysql-client
sudo apt install mariadb-client
sudo pacman -S percona-server-clients
sudo dnf install mysql
There are two ways to connect to a MySQL cluster:
You can copy the connection command from:
the Dashboard tab;
the Connection tab.
If you are using MariaDB 10.10 or higher as the client, use the option
--skip_ssl
when connecting to the cluster.
To create a dump, run the following command:
mysqldump --set-gtid-purged=off -y -u gen_user -p'password' -h ip_dbaas default_db | gzip > default_db.sql.gz
Here:
--set-gtid-purged=off
excludes the SET @@GLOBAL.GTID_PURGED
command, which may cause errors if privileges are insufficient.
-y (--no-tablespaces)
excludes tablespaces, preventing possible errors during dump creation.
To import a dump, run:
cat default_db.sql.gz | gzip -d | mysql -u gen_user -p'password' -h ip_dbaas default_db
This command decompresses the dump and pipes it into the MySQL client for execution.