How to create a MySQL database and database user
Most websites (WordPress, shops, forums) store their content in a MySQL database. You need three things: a database, a database user with a password, and the user added to the database. The server runs MariaDB, which is compatible with MySQL.
Steps
- Log in to the control panel (
https://<server>:2083). - Open MySQL Databases in the menu (section Databases).
- Under Create database, enter a name, for example
shop, and click Create. Your username is added in front: the database is calledusername_shop. - Under Create database user, enter a name, for example
shop, and a password, or click Generate. Click Create. The user is calledusername_shop. Copy the password now. - Under Add user to database, choose the User and the Database and click Grant all privileges.
The database appears under Databases with the user under Privileged users.
The details for your website
| Setting | Value |
|---|---|
| Database name | username_shop (the full name, with the prefix) |
| Username | username_shop |
| Password | the password from step 4 |
| Host | localhost |
See database connection details for examples in PHP and other languages.
Good to know
- Names: lowercase letters, digits and
_, up to 32 characters after the prefix. The namespmaandpgtoolare reserved. - Passwords: at least 8 characters, with three of: lowercase letters, uppercase letters, digits, symbols.
- New databases use the
utf8mb4character set (utf8mb4_unicode_ci), which supports every language and emoji. - Your plan sets how many databases you can have. The top of the page shows how many are used; MySQL and PostgreSQL databases count together.
- One user can be added to several databases, and one database can have several users.
- Installing WordPress or an application from the panel creates its own database and user automatically.
- Delete next to a database removes it with all its data. There is no undo; keep a backup.
Common questions
Why does my site say "Access denied for user"?
The user is not added to the database, the password is wrong, or the name is missing its prefix. See fixing database connection errors.
Can I create a database from phpMyAdmin?
No. Create databases here in MySQL Databases; they then appear in phpMyAdmin.
Can I rename a database?
No. Create a new database, copy the data into it (export and import), and delete the old one.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- How to add a user to a MySQL database (privileges)
Give a database user access to a MySQL database with Grant all privileges, remove its access again, and understand which privileges the user gets.
- MySQL connection details: host, port, socket and examples
The database host (localhost), port 3306, socket path, name and user format to connect WordPress, PHP, Laravel, Node.js or Python to MySQL, with examples.
- How to open phpMyAdmin to manage your MySQL databases
Open phpMyAdmin from the control panel with one click, without a database password, on its own port 2097, and what you can and cannot do there.
- How to import a MySQL database (.sql file) and size limits
Import a .sql or compressed .sql.gz backup into a MySQL database with phpMyAdmin (up to 512 MB) or the mysql command over SSH for larger files.