Установка PhpMyAdmin в Ubuntu 20.04
PhpMyAdmin — это веб-приложение с открытым исходным кодом, написанное на языке программирования PHP и представляющее собой веб-интерфейс для администрирования СУБД MySQL. Главной особенностью данного приложения является возможность управления MySQL без непосредственного ввода SQL команд. Приложение позволяет создавать и редактировать таблицы, вносить в них данные, администрировать пользователей баз данных, а также экспортировать и импортировать записи и структуру таблиц из базы данных.
В этой статье мы рассмотрим, как выполняется установка phpMyAdmin на Ubuntu 20.04 с веб-сервером Apache. Прежде чем приступать к установке phpMyAdmin, у вас уже заранее должны быть установлены такие компоненты, как Apache, MySQL и PHP. Если ещё нет, то сначала посмотрите статью установка LAMP Ubuntu 20.04.
Установка phpMyAdmin в Ubuntu 20.04
Прежде чем мы сможем установить phpMyAdmin Ubuntu, необходимо убедиться, что у вас установлено расширение php для работы с текстовыми строками в формате юникода. Для его установки выполните в терминале команду:
sudo apt -y install php-mbstring
Установщик спросит вас, какой веб-сервер будет использоваться для работы программы. Отметьте с помощью кнопки Пробел пункт apache2, а затем с помощью Tab и Enter нажмите кнопку Ок:
Теперь phpMyAdmin будет доступен по адресу ip_вашего_сервера/phpmyadmin. Вы можете проверить, всё ли работает, просто открыв этот адрес в браузере:

1. Создание пользователя для phpMyAdmin
По умолчанию, вы не сможете авторизоваться в phpMyAdmin от пользователя root, потому что по умолчанию данная особенность отключена. В целях безопасности включать данную опцию не рекомендуется. В данном случае необходимо создать нового пользователя и наделить его полномочиями root. Для создания нового пользователя перейдите в консоль MySQL введя команду в терминале:
sudo mysql -u root -p
После ввода пароля root пользователя MySQL, введите следующие команды:
CREATE USER ‘test’@’localhost’ IDENTIFIED BY ‘пароль’;
GRANT ALL PRIVILEGES ON *.* TO ‘test’@’localhost’;
При помощи первых двух команд был создан новый пользователь с именем test, ему был присвоен пароль и предоставлены все возможные привилегии (такие как создание, удаление, редактирование баз данных, таблиц и т.д.). Третья команда обновляет заданные ранее привилегии.


2. Защита phpMyAdmin
Если phpMyAdmin установлен на производственном сервере, который доступен из сети, то его необходимо обезопасить, добавив авторизацию. Для этого создайте файл /usr/share/phpmyadmin/.htaccess со следующим содержимым:
sudo vi /usr/share/phpmyadmin/.htaccess
AuthType Basic
AuthName «Restricted Files»
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user

Чтобы настройки из файла .htaccess заработали в этой директории, необходимо, чтобы для неё в файле /etc/apache2/apache2.conf значение AllowOverride было All:
sudo vi /etc/apache2/apache2.conf
<Directory /usr/share>
AllowOverride All
Require all granted
</Directory>
Теперь, если вы попытаетесь открыть phpMyAdmin, то вам необходимо пройти авторизацию:

Как удалить phpMyAdmin с Ubuntu
Чтобы удалить phpMyAdmin, необходимо выполнить команду:
sudo apt purge phpmyadmin
После выполнения этой команды программа будет удалена с вашего компьютера.
Выводы
В этой небольшой статье мы рассмотрели, как установить PhpMyAdmin на Ubuntu 20.04. Как видите, всё стало намного проще, чем в предыдущих версиях, когда нам нужно было вручную включать различные модули и настраивать местоположение файлов программы.
Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.
How to Uninstall phpMyAdmin on Ubuntu: A Step-by-Step Guide

If you have previously installed phpMyAdmin on your Ubuntu system and now wish to remove it, this guide will show you how to uninstall phpMyAdmin step by step. We will cover both manual removal and using package managers for a complete uninstallation process.
Uninstalling phpMyAdmin using package managers
First, we will cover how to uninstall phpMyAdmin using package managers like apt or apt-get.
Step 1: Update package lists
Start by updating the package lists for upgrades and package removals:
Step 2: Uninstall phpMyAdmin
Now, you can proceed to uninstall phpMyAdmin using the following command:
Confirm the uninstallation when prompted, and phpMyAdmin will be removed from your system.
Manually removing phpMyAdmin
If you have installed phpMyAdmin manually, you can follow these steps to remove it.
Step 1: Locate phpMyAdmin installation
Find the directory where phpMyAdmin was installed. The default location is usually /usr/share/phpmyadmin or /var/www/html/phpmyadmin. In this example, we will use the default /usr/share/phpmyadmin location.
Step 2: Remove the phpMyAdmin directory
Once you have located the installation directory, you can remove it using the following command:
This command will completely remove the phpMyAdmin directory and all its contents from your system.
Step 3: Remove phpMyAdmin configuration file
Next, remove the phpMyAdmin configuration file located in the /etc/apache2/conf-available/ directory:
Step 4: Disable phpMyAdmin configuration
Disable the phpMyAdmin configuration in Apache using the following command:
Step 5: Restart Apache web server
Finally, restart the Apache web server for the changes to take effect:
By following these steps, you will have successfully uninstalled phpMyAdmin from your Ubuntu system, whether you used a package manager or installed it manually.
Thank you for reading this guide on how to uninstall phpMyAdmin on Ubuntu. If you have any questions or need further assistance, please feel free contact us
This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.
Cookie and Privacy Settings
We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.
Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.
These cookies are strictly necessary to provide you with services available through our website and to use some of its features.
Because these cookies are strictly necessary to deliver the website, you cannot refuse them without impacting how our site functions. You can block or delete them by changing your browser settings and force blocking all cookies on this website.
We also use different external services like Google Webfonts, Google Maps and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.
Google Webfont Settings:
Google Map Settings:
Vimeo and Youtube video embeds:
You can read about our cookies and privacy settings in detail on our Privacy Policy Page.
How to Uninstall phpMyAdmin in Ubuntu Server
Following tutorial explains how to uninstall phpMyAdmin on Ubuntu 18.04 Server, you can also use following method on any previous Ubuntu release. We will also discuss how to enable and disable phpMyAdmin without uninstalling the phpMyAdmin package.

To uninstall phpMyAdmin in Ubuntu, open the terminal and run the following set of commands:
The «apt-get remove phpmyadmin» command will uninstall the phpmyadmin package, the purge command will remove configuration files related to Ubuntu phpMyAdmin and the autoremove command will uninstall all the dependency packages that are no longer required.
If you want to reinstall phpMyAdmin on Ubuntu, run:
Disable phpMyAdmin without uninstalling
If you just want to disable access to the phpMyadmin, you could simply disable the phpMyAdmin without uninstalling it.
How to Install, Uninstall & Remove phpMyAdmin – Ubuntu
How to install, uninstall and remove phpMyAdmin from Ubuntu. phpMyAdmin is a very popular MySql Administration tool used my million of developers.
What is phpMyAdmin
phpMyAdmin is very popular MySql administration tool. Using phpMyAdmin, you can do a lot of administrative work through their user interface such as (managing databases, tables, columns, relations, indexes, users, permissions, etc).
How to Install phpMyAdmin on Ubuntu
Before installing phpMyAdmin, I assume you have already installed LAMP in your system. If you have not installed LAMP, then check my previous tutorial on how to install LAMP on Ubuntu.
To install phpMyAdmin on Ubuntu, open the terminal and type following commands.
apt-get is a popular package management tool used in Debian Linux distributions.
Now your phpMyAdmin installation is in progress. To configure installation correctly it asks some questions.

How to Install, Uninstall & Remove phpMyAdmin
* Choose apache2 and press ok.
* In next prompt, select yes when asked whether to use dbconfig-common to set up the database.
* In final and last prompt it’ll ask database administrator’s password. You will then be asked to choose and confirm a password for the phpMyAdmin application itself.