Tudásbázis

Installing phpMyAdmin Nyomtatás

  • phpmyadmin, mysql, database, php
  • 0

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 mysqli and mbstring PHP 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

  1. When the Debian/Ubuntu package prompts, choose your web server (apache2 or nginx) and answer Yes to configuring a database with dbconfig-common if you want the control tables stored in MySQL.

  2. 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

  1. 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; } }

  1. Reload the web server and open the domain:

```bash sudo nginx -t && sudo systemctl reload nginx

then visit https://db.example.com

```

  1. 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

  1. Put phpMyAdmin behind HTTPS with a Let's Encrypt certificate.
  2. Restrict access by IP or add HTTP basic authentication.
  3. Consider setting a blowfish_secret and an AllowNoPassword = false policy.

Troubleshooting

  • Problem: "The mysqli extension is missing". Solution: Install php-mysqli and 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@localhost vs user@'%').
  • Problem: "Configuration file needs a secret passphrase". Solution: Set a 32-byte blowfish_secret in config.inc.php.

Related articles

  • [Installing MySQL and MariaDB]
  • [Managing databases from the command line]
  • [Setting up a free Let's Encrypt SSL certificate]

Hasznosnak találta ezt a választ?

« Vissza