Creating and using databases
Create MySQL and PostgreSQL databases and users, connect your site to them, and get data in or back from a backup.
Most web applications keep their content in a database. On Hosting → Databases you create MySQL and PostgreSQL databases, and the users your site signs in with. If you install WordPress from the panel, it creates its own MySQL database and user for you (see installing WordPress), so you only need this page for other applications.
Create a database
- Open Hosting → Databases and open Create Database.
- Enter the Database Name: letters, numbers and underscores, up to 64.
Names are unique on the server, so add something of your own, such as
shop_example. - Choose the Type, PostgreSQL or MySQL. Use whichever your application asks for; most PHP applications want MySQL.
- Choose the Domain it belongs to and press Create Database.
The status shows Creating for a moment, then active. If it shows Needs review, press Retry creation, and ask your host if it keeps failing. Your plan may limit how many databases you can have; the form says so when you reach it.
Add a user
A database can't be used until it has a user.
- Press Users next to the database.
- Under Add User, enter a Username (letters, numbers and underscores, up to 32) and a Password of at least 8 characters.
- For MySQL, leave Access at Localhost only unless you need remote access (below).
- Press Add User.
Keep the password somewhere safe: the panel can't show it again.
To change a MySQL user's password, press Edit next to it, enter a New Password and press Save Changes. A PostgreSQL user can't be edited: to change its password, delete the user and add it again, then update your site's settings.
Connect your site
Enter these in your application's settings, such as WordPress's
wp-config.php or a .env file:
| Setting | MySQL | PostgreSQL |
|---|---|---|
| Host | localhost |
localhost |
| Port | 3306 | 5432 |
| Database | The database name | The database name |
| User and password | The user you added | The user you added |
Your site runs on the same server as the database, so it always connects to
localhost, never to your domain name or the server's address.
Connect from your own computer (MySQL)
To use a desktop tool such as MySQL Workbench or HeidiSQL, a MySQL user needs remote access. Press Edit next to the user, set Access to Allow specific remote host, enter your computer's public IP address or hostname under Allowed IP or Hostname, enter a New Password (it's required to save the change), and press Save Changes. The user can then sign in from that address as well as from the site.
The server also has to accept database connections from outside. If your tool can't connect, ask your host whether they allow it. The panel offers remote access for MySQL users only.
Import or export data
The Databases page doesn't import or export database files. To get data in or out:
- Use your application. Many have their own export and import, or a plugin for it (WordPress has several).
- Use a desktop tool over remote access (MySQL, above). It can import an SQL file into the database and export one from it.
- Restore from a backup. On your domain's Backups tab, you can put a database back the way it was in one of the server's backups. The database is replaced by the backup's copy, so anything added since is lost.
There's no phpMyAdmin for customer accounts. If you're moving a whole site from another host, ask your host: they may be able to bring it over for you.
Delete a database or user
Press Delete next to a database or user and confirm. This can't be undone, so make sure you have a copy of anything you need first.