Docs

Databases

Creating MySQL databases and database users, giving users rights, phpMyAdmin, downloading and restoring databases, repairs, and Remote Database Access.

5 min read Updated From the panel's guide

Most website software, such as WordPress, shop systems and forums, keeps its content in a MySQL (MariaDB) database. A website connects to its database with a database user and that user's password. In the client area you create the databases and users, decide which user may use which database, and work with the data in phpMyAdmin.

In the modern look these tools are under Databases in the menu; in the classic look in the Databases group on the Tools page. The Overview tab shows how many databases and database users you have.

My Databases: creating a database#

To create a database, open My Databases (the Databases and users tab under Databases).

  1. In the Databases box, type a name after the prefix shown in front of the box. The prefix is your account name and _, so shop becomes for example myacct_shop. Use small or capital letters, digits and "_" (up to 47 characters). Capitals are kept: myacct_Shop and myacct_shop are two different databases.
  2. Choose Create database.

The list shows each database with the Users with access, a Download button and a Delete box.

To delete a database: type its full name in the box next to it and choose Delete. This deletes all its tables and data for good; download a copy first if you may need it.

Good to know:

  • The prefix is added to every database and user name automatically and cannot be left out.
  • Your hosting package may limit the number of databases.
  • Databases count towards your account's disk space. When the account is at its disk limit, new databases are refused.
  • WordPress installed with the WordPress Manager gets its own database automatically.

My Databases: database users#

A database user is the login a website uses to reach its databases. Open My Databases and find the Database users box.

To create a user:

  1. Type a name after the prefix (small or capital letters, digits and "_", up to 63 characters).
  2. Enter a password of at least 10 characters.
  3. Choose Create user.

A new user cannot use any database yet; give it access as described in the next section.

In the list you can set a New password for a user (Change) or Delete the user. Deleting a user does not delete any database.

Good to know:

  • If you change a user's password, also change it in your website's configuration file (for WordPress, wp-config.php), or the website can no longer reach its database.
  • Database users are separate from your panel login, mailboxes and FTP logins.
  • Use a separate user for each website, so a problem with one website cannot reach the data of another.

My Databases: giving a user access (privileges)#

A user needs access to a database before a website can use it. Open My Databases and find Give a user access to a database (shown once you have at least one database and one user).

  1. Choose the User and the Database.
  2. Choose the rights:
    • with all rights: the usual choice for a website's own user.
    • with only the rights ticked below: then open Individual rights and tick what the user may do.
  3. Choose Give access.

The rights you can tick are SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, REFERENCES, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE, EVENT and TRIGGER. Reading needs SELECT; a website that stores data also needs INSERT, UPDATE and DELETE. Software that installs or updates itself usually needs CREATE, ALTER, INDEX and DROP too.

The database list then shows the user under Users with access. To take access away, choose the × next to the user's name there.

Giving access again replaces the rights the user had in that database.

In your website's settings use host localhost, the full database name, the full user name and that user's password.

Downloading, restoring and repairing a database#

These tools are on My Databases.

Download a database: choose Download next to it. You get a compressed SQL dump (.sql.gz) of the whole database. Do this before big changes, such as a software update.

Restore a database from an SQL file:

  1. Upload the .sql or .sql.gz file into your home folder with the File Manager or FTP.
  2. In Restore a database from an SQL file, choose the database and enter the file's path, for example backups/mydatabase.sql.gz.
  3. Choose Restore.

The statements in the file run on the chosen database only. Tables of the same name are replaced by what the file holds, so download a copy of the database first if in doubt. Large files take a few minutes.

Check and repair a database: choose the database, then Check database to look at every table for damage, or Repair database to also mend the damaged tables where their kind allows it. Your website keeps working meanwhile; a large database takes a while.

phpMyAdmin#

phpMyAdmin lets you browse and edit your databases in the browser: look at tables, run SQL queries, import and export. Open it with phpMyAdmin (the Open phpMyAdmin button on My Databases, or phpMyAdmin in the tools list). It opens in a new browser tab.

You are signed in automatically and see all databases of your account, and only those. You do not need a database user's password for this.

If the automatic sign-in fails, phpMyAdmin's own sign-in page appears; you can sign in there with one of your database users and its password, and then see the databases that user has access to.

Good to know:

  • Changes in phpMyAdmin take effect at once and cannot be undone. Download the database first before larger changes.
  • Use Download and Restore a database from an SQL file on My Databases for whole-database copies; they handle large databases better than phpMyAdmin's import in the browser.
  • Creating databases and users is done on My Databases, not in phpMyAdmin, so they get your account's prefix.

Remote Database Access#

Normally only this server itself can use your databases. Remote Database Access lets other computers connect over the network, for example another web server, an office computer or a reporting tool. Open Remote Database Access (the Remote database access box on My Databases).

To allow a computer:

  1. Enter its IP address, such as 203.0.113.20.
  2. Choose Allow this address.

That computer can then sign in with your database users and their passwords, on the database port (3306) of this server. The server's firewall is opened for that address only.

The list shows the addresses you allowed, with Remove, and addresses allowed for all accounts by your hosting provider (marked Your hosting provider), which you cannot remove.

Good to know:

  • Give a fixed IP address. Home connections often change their address; then the access stops working.
  • You can allow up to 10 addresses.
  • Use strong passwords for database users that are reachable from outside.
  • The host name to connect to is this server's name or IP address (see Server Information), not localhost.
Was this article helpful?

Something missing? Ask in the community or open a ticket.