Databases: creating, credentials, import and backups
Your hosting's databases live in the panel on the hosting's page, under the Services tab, in the Databases tile ("MySQL / PostgreSQL databases"). The tile only appears if the hosting has MySQL enabled or already has a PostgreSQL database.
Which database engines are available
CloudWeb offers two database engines:
- MySQL / MariaDB – available whenever your hosting has MySQL enabled. This is the default and most common case.
- PostgreSQL – availability depends on whether the server your hosting runs on has an active PostgreSQL service, or whether you already have a PostgreSQL database on the hosting. This is a property of the server, not of your plan.
The Create Database dialog in the panel only creates a MySQL database – it does not let you choose the engine, charset or collation. A new database always gets charset utf8mb4 and collation utf8mb4_unicode_ci.
Plan limits
How many databases a hosting can have is set by the plan (the max_databases field):
| Plan | Max. databases |
|---|---|
| Starter | 1 |
| Business | 20 |
| Professional | 50 |
| Vizitka / Vizitka + e-mail | 0 (databases are not part of this plan) |
Once the limit is reached, the panel refuses to create another database and reports how many the plan allows and how many you already have. If you need more databases than your current plan allows, you can change your hosting plan.
Creating a database
- On the databases list, click Create Database.
- Enter a database name – only letters, digits and underscores are allowed (max 32 characters). Invalid characters are replaced with an underscore automatically.
- Type a password, or generate one with the Generate button.
- Once confirmed, the database is created with a name built from a random string, your domain and the name you chose, to avoid collisions between customers sharing the same server.
Creation happens in the background – until the database is ready it shows status "creating", and it cannot be imported into or deleted in that state.
Credentials and connecting from your app
For every database in the list, the Credentials action opens a window with:
- the database name,
- host and port,
- the username and password,
- a ready-made Laravel
.envblock (DB_CONNECTION,DB_HOST,DB_PORT,DB_DATABASE,DB_USERNAME,DB_PASSWORD), - and, for a MySQL database, a ready-made PHP
mysqli_connect(...)call.
The database runs on the same node as your hosting, so your app does not connect to it over a public IP address – it connects over an internal network name: for MySQL that is host mysql on port 3306, for PostgreSQL host postgresql on port 5432. That is exactly the value the panel fills into the Host field – use it, not localhost or the server's IP address.
phpMyAdmin
The phpMyAdmin button in the Databases page header signs you in to https://pma.cloudweb.sk using the same credentials shown in that database's Credentials window. There is no equivalent tool (pgAdmin) for PostgreSQL.
Importing a SQL dump
The Import action on a database opens a dedicated page where you can upload a .sql, .sql.gz or .sql.zip file. The file is uploaded in small pieces, so there is no fixed size limit on the upload – small pieces get around the usual per-request limits.
Before the import runs, the panel reads the dump and flags things such as:
- a DEFINER this server does not have,
- collations this server may not support,
- the dump's own
CREATE DATABASE/USEstatements, - MyISAM tables,
- a
latin1charset, - a dump that destroys data first (DROP/DELETE/TRUNCATE).
For some findings you can tick a fix (e.g. stripping DEFINER clauses, rewriting collations, combining single-row inserts) – the dump is rewritten as it is sent, your data is not touched. You can also enable Drop existing tables or Add IF NOT EXISTS to CREATE statements. The database is temporarily unavailable while an import runs; stopping one halfway leaves in place whatever it had already written.
If an import fails or is stopped halfway, the import page offers an Empty the database button – it irreversibly drops every table and view so you can start a clean import.
Backups of a single database
The Backups action on a database opens a window with that database's own backups (separate from the whole-hosting backups found under a different tab – see Hosting backups). You can create a full or incremental backup; at most one backup per hour per database. A completed backup can be downloaded, used to restore the database (overwriting its current contents), pushed to remote storage, pulled back locally, or deleted (individually or in bulk).
Deleting a database
The Delete action permanently removes a database and its data. A database cannot be deleted while it is still being created.
Additional database users
On top of the main database access, you can create additional database users with their own name, password and privileges.
Was this article helpful?
Your feedback helps us improve our documentation