phpMyAdmin is a popular web-based tool for managing MariaDB and MySQL databases. It provides a user-friendly interface for creating and managing databases, tables, columns, and users.
Some benefits of using phpMyAdmin include:
- Intuitive interface: PHPMyAdmin’s web-based interface is designed to be easy to use, even for those who are new to database management.
- Database management: phpMyAdmin allows you to create and manage databases, tables, and columns, as well as import and export data.
- User management: phpMyAdmin allows you to create and manage users and their permissions, making it easy to control access to your databases.
- SQL execution: phpMyAdmin allows you to execute SQL commands directly from the web interface, making it easy to make changes to your databases.
- Server administration: phpMyAdmin allows you to perform server-level tasks, such as optimizing and repairing tables.
- Reports and statistics: you can generate reports and statistics on tables, sizes and indexes usage in your databases.
- Multi-language support: phpMyAdmin is available in multiple languages, making it accessible to users around the world.
- Support for multiple operating systems: phpMyAdmin is compatible with a wide range of operating systems, including Windows, Linux, and macOS.
Overall, phpMyAdmin is a powerful tool that can simplify the process of managing MariaDB and MySQL databases, making it a great choice for administrators and developers who need to work with databases on a regular basis.
- Debian 11
- PHP 8.1
The process for installing phpMyAdmin on Debian 9 and 10, as well as Ubuntu 18.04 and 22.04 servers, is similar to the process I described in my previous answer for Debian 11. However, there are some minor differences that you should be aware of:
- Debian 9 and 10: The package names and repository URLs may be different, so you may need to use different commands to install phpMyAdmin and its dependencies.
- Ubuntu 18.04 and 22.04: The package names and repository URLs may be different, so you may need to use different commands to install phpMyAdmin and its dependencies.
- PHP version: You may have different version of php, like php7.2 or php7.4, so you should use the correct version of the packages that depend on it, for example,
sudo apt-get install php7.4-mcryptinstead of
sudo apt-get install php8.1-mcrypt
- In all cases, you will need to make sure that you have Apache2, PHP, and MariaDB or MySQL installed on your server before you can install phpMyAdmin.
The general steps for installing phpMyAdmin on these systems are the same as described in my previous answer, but you may need to adjust the commands and package names based on the specific version of the operating system you are using.
Here are the steps to install phpMyAdmin on your Debian 11 server:
- Install phpMyAdmin:
sudo apt-get update
sudo apt-get install phpmyadmin
- During the installation, you will be prompted to select the web server that should be automatically configured to run phpMyAdmin. Select Apache2.
- Configure phpMyAdmin to use the MariaDB server. Edit the file /etc/phpmyadmin/config.inc.php and add the following line at the end:
$cfg['Servers'][$i]['host'] = 'localhost';
- Enable the PHP mcrypt and mbstring extensions:
sudo apt-get install php-gd php-json php-mysql php-zip php-mbstring php-mcrypt
- Access phpMyAdmin by going to the URL http://your-server-ip/phpmyadmin. You should be prompted to enter your MariaDB username and password.
- If you want to allow access to phpMyAdmin from any IP address, you should edit the file /etc/phpmyadmin/config.inc.php and change the line $cfg[‘Servers’][$i][‘AllowNoPassword’] = false; to $cfg[‘Servers’][$i][‘AllowNoPassword’] = true;
- To further secure your phpMyAdmin installation, you should also add authentication to the phpMyAdmin directory in Apache.
sudo nano /etc/apache2/conf-enabled/phpmyadmin.conf
add the following lines at the end of file.
AuthName "Restricted Files"
- Now create the .htpasswd file and add a user
sudo htpasswd -c /etc/phpmyadmin/.htpasswd username
Please note that these steps are for a basic setup, you may need to further customize the configuration to meet your specific needs.