ServerAvatarDocs
Databases

Application databases

Link a database to an application, create one for an application, and open a database in phpMyAdmin or Adminer.

A database can be attached to one of the server's applications. The link tells Central which application the database belongs to. It shows on both pages, and it decides which application's backups include the database. It does not connect the application to the database: the application keeps using whatever its own configuration says.

See an application's database

Open the application, then Overview. The Database card shows the attached database with its engine, Size, Users and Character set.

The Database card on an application's Overview with the database name, its engine, size, number of users and character set, and the Manage button

The database name and Manage open the database's page. Without a database the card says "No database is attached to this application." Docker applications have no Database card. See Applications.

On the database's page, Used by in the Details card names the application, or says "Not attached to an application". The note under the cards tells you what it means for backups:

  • "Included in this application's backups."
  • "Not linked to an application, so no backup includes it."
  • "Linked to an application you cannot see." You lack View on Application.

Create a database for an application

  1. Open Databases in the server's sidebar and select Create database. See Databases and users.
  2. In Application, choose the application. The default is Not for an application. "The database shows on this application's page. You can change it later."
  3. Fill in the rest and select Create.

When you create an application that needs a database, you choose the engine in the create form. See Create an application.

Attach, move or detach a database

  1. Open the database's page. In the Details card, next to Used by, select Attach to an application, or Change if one is attached. In the server's Databases list you can also select Not linked in the Application column.

  2. In the dialog Which application uses this database? ("Choose the application name belongs to."), open Used by.

    The dialog Which application uses this database with the Used by list set to acme-landing and the explanation that it does not connect your application to the database

  3. Choose the application, or Not linked to an application to detach the database. Each application shows its domain under its name. Use Search applications… to find one. An application that already has a database is greyed out with Already has a database.

  4. Select Save. It stays disabled until you pick something different ("Pick a different application first."). You see "Database linked to the application." or "Database is no longer linked to an application."

Moving a database to another application is the same dialog: choose the other one. Detaching does not delete the database.

Open a database in phpMyAdmin or Adminer

phpMyAdmin and Adminer are web tools for browsing and editing a database. Central signs you in with one click.

  • MySQL and MariaDB databases can use phpMyAdmin and Adminer.
  • PostgreSQL databases can use Adminer.
  1. Open the database's page. The buttons are at the top right of the header: Open in phpMyAdmin and Open in Adminer. When the server has no phpMyAdmin the first one reads Install phpMyAdmin: it opens Create application for phpMyAdmin on this server.
  2. Select the button. It says Opening…, and the tool opens in a new browser tab.
  3. To sign in as a certain user, open the arrow next to the button, find Sign in as and choose The database's first user or one of the users. The arrow also holds the other tool.

The sign-in link works once and for 60 seconds. The lists have the same actions in the row's ⋯ menu (Open in phpMyAdmin, Open in Adminer) when the server has the tool.

If it does not work:

  • Add a database user first — tool signs in as one. The database has no user. Add one on the Users tab.
  • tool could not be opened. The sign-in failed. The server's reason, such as no phpMyAdmin site, is shown on the page. Try again.
  • The buttons are disabled for a view-only role: "Your role can view databases but not change them."

Delete an application and its databases

When you delete an application, the dialog offers Also delete its databases. See Applications.

Who can do this

  • Manage on Databases (server.database) is needed to attach, move or detach a database and to sign in to phpMyAdmin or Adminer.
  • View on Application is needed to choose an application: "Choosing an application needs view access to Applications."
  • Install phpMyAdmin needs Manage on Application.

On this page