Overview
phpMyAdmin is a browser-based tool for managing MySQL and MariaDB databases: running queries, browsing tables, importing and exporting dumps. It is convenient for occasional administration and for users who prefer a GUI. This article shows how to install it on an ALYPOD CPU Pod behind Apache or Nginx.
Before you begin
- A CPU Pod with Apache or Nginx, PHP 8.1+ and MySQL/MariaDB.
- The
mysqliandmbstringPHP extensions. - A domain or subdomain, ideally protected by HTTPS.
Steps
Install the package
```bash
Debian / Ubuntu
sudo apt update && sudo apt install -y phpmyadmin
RHEL family (EPEL)
sudo dnf install -y epel-release sudo dnf install -y phpmyadmin ```
Configure
When the Debian/Ubuntu package prompts, choose your web server (apache2 or nginx) and answer Yes to configuring a database with
dbconfig-commonif you want the control tables stored in MySQL.Make sure the PHP extensions exist:
bash
sudo apt install -y php-mysqli php-mbstring
sudo systemctl reload php8.2-fpm apache2 # adjust as needed
- For Nginx, add a server block pointing at the phpMyAdmin directory:
nginx
server {
listen 80;
server_name db.example.com;
root /usr/share/phpmyadmin;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
}
- Reload the web server and open the domain:
```bash sudo nginx -t && sudo systemctl reload nginx
then visit https://db.example.com
```
- Log in with a MySQL user. Do not use root for daily work — create a dedicated admin user with only the privileges you need.
Secure it
- Put phpMyAdmin behind HTTPS with a Let's Encrypt certificate.
- Restrict access by IP or add HTTP basic authentication.
- Consider setting a
blowfish_secretand anAllowNoPassword= false policy.
Troubleshooting
- Problem: "The mysqli extension is missing". Solution: Install
php-mysqliand reload PHP-FPM/web server. - Problem: Login fails with a valid password. Solution: Confirm the user is allowed
to connect from the web server host (
user@localhostvsuser@'%'). - Problem: "Configuration file needs a secret passphrase". Solution: Set a 32-byte
blowfish_secretinconfig.inc.php.
Related articles
- [Installing MySQL and MariaDB]
- [Managing databases from the command line]
- [Setting up a free Let's Encrypt SSL certificate]
