MySQL database, or website database, is a SQL DB that consists of several related tables in which all information about the website is saved. The database includes data tables (objects), data types, users, groups, statistics, etc.

Using cPanel you may create one or several MySQL databases.
How to do it?

1. Go to the CPanel.
2. Press “MySQL database” icon at the main page in the “Databases” section.

Добавление MySQL БД

3. MySQL database creation.Type the database name in the “Create database” field. Let`s name it “newdb”.

Добавление MySQL БД
Press “Create database” button and the DB will be successfully created.

Добавление MySQL БД

Note, that your username prefix in cPanel will be added to the name of your database.
To work with the database you have to create a special database user.

4. MySQL Database user creation

Enter the username (up to 7 symbols) and the password (you may generate it using “Password Generator” or any other service) in the “Username” field (“MySQL users” tab):

Username: userdb
Password: ●●●●●●●●●●●● (the password will be hidden, if you use the password generator don’t forget to save the password)
Password (confirm): ●●●●●●●●●●●● (repeat your password once more, if you use a password generator, this field will be filled in automatically)
Создание пользователя MySQL БД

Strength indicator analyses if the entered password is resistant to brute force attack or not.
Press “Create user” button and the user will be successfully created.
Please note that your username was added to the database username.

5. Now you have to give rights to the user for the database.

Now we have to connect user “dnstools_userdb” and the created database “dnstools_newdb”. PressAdd user to the database”” button.
Select the created user and database from the list and press “Save” button.

Создание пользователя MySQL БД

You are redirected to the page where you may give the rights of the database management to the user
Управление MySQL БД

To assign all the privileges put a tick on “ALL RIGHTS” and click on the “Make changes” button..
If the rights have been changed successfully you will receive the notification:
Добавление пользователя MySQL БД

The created database is ready for work now.
6. In scripts you have to write the following meanings (according to our example):

dbhost: localhost     # Server of MySQL DB.
dbname: sv03aiw_newdb  # Full name of the database
dbuser: sv03aiw_userdb  # Full name of the database user
dbpassword: FGh45yhaw  # Password that was generated during the user creation

In different scriptі variable names in the configuration file may vary slightly.