phpMyAdmin is a web-based interface used for managing MySQL and MariaDB databases. It allows database administrators to perform tasks such as managing databases, running queries, and managing user permissions through an easy-to-use web interface. Installing phpMyAdmin on Ubuntu or Debian systems involves configuring the web server and the necessary dependencies such as Apache and PHP.
The installation process is straightforward using the apt package manager. It automatically installs related packages like php-mysql and mysql-client, though the MySQL or MariaDB server must be installed separately. The setup also includes configuration steps to connect phpMyAdmin with your database and set up secure credentials.
This guide is applicable for Ubuntu and other Debian-based systems. The process covers the basic installation of phpMyAdmin, with optional steps for additional configuration depending on your system setup and requirements.
Steps to install phpMyAdmin on Ubuntu or Debian:
- Update the system package list.
$ sudo apt update Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [5284 B] Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [7432 B] Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [7688 B] Fetched 25.4 kB in 2s (12.7 kB/s) Reading package lists... Done
- Install phpMyAdmin via the apt package manager.
$ sudo apt install --assume-yes phpmyadmin Reading package lists... Done Building dependency tree... Done The following additional packages will be installed: apache2 apache2-bin apache2-data php php-mysql 0 upgraded, 5 newly installed, 0 to remove. Need to get 7.6 MB of archives. After this operation, 42.1 MB of additional disk space will be used.
- Select your preferred web server during installation.
Use <tab> to navigate and select either Apache2 or your installed web server.
- Configure phpMyAdmin to use dbconfig-common.
Select Yes when prompted to configure the database for phpMyAdmin automatically.
- Set a password for phpMyAdmin access.
Enter a secure password that you will use to access phpMyAdmin from the web.
- Enter the MySQL root password.
This is the password of your MySQL or MariaDB server's root account.
- Restart the web server to apply changes.
$ sudo systemctl restart apache2
- Edit configuration files for phpMyAdmin if needed.
Apache configuration file:
/etc/apache2/conf-enabled/phpmyadmin.conf
phpMyAdmin configuration file:
/etc/phpmyadmin/config.inc.php
- Access phpMyAdmin via your browser using the server’s IP address or localhost.
$ curl 127.0.0.1/phpmyadmin
This guide is tested on Ubuntu:
Version | Code Name |
---|---|
22.04 LTS | Jammy Jellyfish |
23.10 | Mantic Minotaur |
24.04 LTS | Noble Numbat |
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.