# phpMyAdmin

URL: https://docs.vaultpanel.net/guides/databases/phpmyadmin

> Set up phpMyAdmin on a server's own port, sign in with a database user, or open any database in phpMyAdmin already signed in from the panel.

phpMyAdmin is the classic web interface for MySQL and MariaDB. VaultPanel installs it from the
system's packages, so it gets security updates with the rest of the system, and serves it with NGINX
on a port of its own. From the panel, each database opens in phpMyAdmin already signed in.

## Set it up

### Check the server's software

phpMyAdmin needs NGINX, PHP-FPM and MariaDB. Install any that are missing on the server's page
first: NGINX and PHP-FPM from the **Web stack** card, MariaDB from the **Database server** card.

### Choose a port

On **Databases**, the **phpMyAdmin** card lists your servers. Click **Set up** next to one and keep
port **8081**, or choose another free port from 1024 to 65535. Ports the panel and common services
use are refused. When the server's firewall is on, VaultPanel opens the port.

### Serve it over HTTPS

When the panel has its own domain with a certificate (**System > Panel Domain**), leave
**Serve it over HTTPS** ticked: phpMyAdmin then uses that certificate at
`https://<panel domain>:8081/`. Over plain HTTP, passwords travel unencrypted.

### Install

Click **Set up phpMyAdmin**. When the job finishes, the card shows the address and
**Open phpMyAdmin**.

If the job fails because nothing answers on the port, another program uses it: open **Settings** on
the card and choose another port.

Setting up, changing and turning off phpMyAdmin needs the `servers.manage` permission.

## Sign in with a database user

phpMyAdmin's login form takes a database user and its password. Find the password on
**Databases > Users** with **Password**. You then see only that user's databases. Signing in as
`root`, or with an empty password, is refused.

## Open a database in phpMyAdmin

Each active database on a server with phpMyAdmin has a **phpMyAdmin** button on **Databases**, and
**Open in phpMyAdmin** at the top of its own page. It opens a new tab already signed in to that
database, with nothing to type. This needs agent 0.19.0 or newer and the `databases.manage`
permission.

It signs in as the database's own full-access account, which reaches only that database, never
root. Behind the scenes, the agent leaves a one-time ticket for a fresh token on the server; the
ticket can be used once and expires after 2 minutes. When you log out of phpMyAdmin, its normal login
form comes back.

Each one-click sign-in is recorded in the audit log as `database.phpmyadmin`.

## Turn it off

Click the power button next to the server on the **phpMyAdmin** card. NGINX stops serving it. The
package stays installed and your databases are not touched; you can set it up again at any time. A
firewall rule opened for its port can be removed on the **Firewall** page.
