Как установить phpMyAdmin на Fedora 32/31/30/29

Как установить phpMyAdmin на Fedora 32/31/30/29

 

В этом руководстве мы рассмотрим, как установить и настроить phpMyAdmin на Fedora 32/31/30/29. PHPMyAdmin — это программный инструмент с открытым исходным кодом, написанный на PHP, предназначенный для администрирования MySQL через веб-интерфейс.

phpMyAdmin поддерживает широкий спектр операций с MySQL, MariaDB и Drizzle. Он часто используется для выполнения общих операций с базами данных (управление базами данных, таблицами, столбцами, связями, индексами, пользователями, разрешениями и т. Д.) Через интуитивно понятный и простой в использовании веб-интерфейс.

Выполните следующие действия, чтобы установить phpMyAdmin в Fedora 32/31/30/29.

Шаг 1. Установите HTTP-сервер Apache и PHP

HTTP-сервер Apache и PHP являются обязательными зависимостями для phpMyAdmin. Сначала установите их:

sudo dnf -y install httpd php php-cli php-php-gettext php-mbstring php-mcrypt php-mysqlnd php-pear php-curl php-gd php-xml php-bcmath php-zip

Настройте основные параметры httpd:

Отредактируйте файл конфигурации /etc/httpd/conf/httpd.conf

ServerAdmin [email protected]
ServerName  example.com
ServerTokens Prod

При желании вы можете установить Keepalive:

KeepAlive On

Включить и запустить  httpd сервис:

sudo systemctl start httpd
sudo systemctl enable httpd

Если firewalld работает, позволяют как  http и  https услуги:

sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --reload

Подтвердите установленную версию PHP:

$ php -v
PHP 7.3.4 (cli) (built: Apr  2 2019 13:48:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies

Загруженные расширения можно просмотреть, передав  -m опцию  phpкоманде

$ php -m

Установить часовой пояс PHP для файла /etc/php.ini

date.timezone = Ukraine/Kiev

Смотрите полный список  поддерживаемых часовых поясов .

Шаг 2. Установите и настройте phpMyAdmin в Fedora 32/31/30/29

После установки PHP и Apache вы можете установить phpMyAdmin

sudo dnf -y install phpMyAdmin

Версия, установленная на моей машине Fedora 4.8.3

$ rpm -qi phpMyAdmin
Name : phpMyAdmin
Version : 4.8.5
Release : 2.fc30
Architecture: noarch
Install Date: Thu 02 May 2019 10:03:16 AM EAT
Group : Unspecified
Size : 26212455
License : GPLv2+ and MIT and BSD
Signature : RSA/SHA256, Sat 02 Feb 2019 08:33:08 PM EAT, Key ID ef3c111fcfc659b9
Source RPM : phpMyAdmin-4.8.5-2.fc30.src.rpm
Build Date : Sat 02 Feb 2019 01:53:43 PM EAT
Build Host : buildvm-ppc64le-15.ppc.fedoraproject.org
Relocations : (not relocatable)
Packager : Fedora Project
Vendor : Fedora Project
URL : https://www.phpmyadmin.net/
Bug URL : https://bugz.fedoraproject.org/phpMyAdmin
Summary : Handle the administration of MySQL over the World Wide Web
Description :
phpMyAdmin is a tool written in PHP intended to handle the administration of
MySQL over the World Wide Web. Most frequently used operations are supported
by the user interface (managing databases, tables, fields, relations, indexes,
users, permissions), while you still have the ability to directly execute any
SQL statement.

Features include an intuitive web interface, support for most MySQL features
(browse and drop databases, tables, views, fields and indexes, create, copy,
drop, rename and alter databases, tables, fields and indexes, maintenance
server, databases and tables, with proposals on server configuration, execute,
edit and bookmark any SQL-statement, even batch-queries, manage MySQL users
and privileges, manage stored procedures and triggers), import data from CSV
and SQL, export data to various formats: CSV, SQL, XML, PDF, OpenDocument Text
and Spreadsheet, Word, Excel, LATEX and others, administering multiple servers,
creating PDF graphics of your database layout, creating complex queries using
Query-by-example (QBE), searching globally in a database or a subset of it,
transforming stored data into any format using a set of predefined functions,
like displaying BLOB-data as image or download-link and much more…

Ограничьте доступ к phpMyAdmin только вашим доверенным сетям

sudo vim /etc/httpd/conf.d/phpMyAdmin.conf

Отредактируйте Require ip строки — как в  строке 17, так и в 34  файла.

Require ip 127.0.0.1 192.168.18.0/24

Сохраните изменения и перезапустите httpd сервис

sudo systemctl restart httpd

Шаг 3: Доступ к интерфейсу phpMyAdmin

Access  [http://(your hostname or IP address)/phpmyadmin/] из вашего любимого веб-браузера и сети в белом списке.

Войдите в систему под своим пользователем базы данных, чтобы начать администрирование операций с базой данных через веб-интерфейс phpMyAdmin.

Шаг 4: измените плагин аутентификации для MySQL 8.0

Чтобы иметь возможность проходить аутентификацию в MySQL 8.0, войдите в MySQL CLI и измените плагин аутентификации.

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'ph/axo>vJe;789';
Query OK, 0 rows affected (0.11 sec)

mysql> QUIT
Bye

Наслаждайтесь администрированием сервера базы данных MySQL или MariaDB с помощью phpMyAdmin.