Ошибка при установке phpmyadmin ubuntu

phpMyAdmin установка, настройка, проблемыPhpMyAdmin самое популярное web ориентированное управление базой данных MySQL. Незаменимый инструмент для всех, кто не дружит с языком команд MySQL сервера.

Для работы phpMyAdmin у вас должны уже стоять и работать

  • MySQL сервер
  • Http сервер с поддержкой php


1.Установка в Ubuntu
2.Установка из исходников
3.Решение проблем при установке phpMyAdmin

Установка в Ubuntu

Установку выполняем командой

sudo aptitude install phpmyadmin

Установщик спросит на какой http сервер ставим – я выбрал apache2, т.к. он уже стоял у меня. Далее скрипт установки попросил создать и сконфигурировать базу данных phpmyadmin – соглашаемся и вводим пользователя и пароль для управления этой базой данных.
После установки все конфиги хранятся в /etc/phpmyadmin. На всякий случай перезапускаем http сервер.

sudo /etc/init.d/apache2 restart

В браузере вводим http://localhost/phpmyadmin/ и авторизуемся от пользователей MySQL сервера.

Авторизация в phpMyAdmin

Авторизация в phpMyAdmin

Установка из исходников

Чтобы представлять что происходит при установке phpMyAdmin, я покажу действия, которые выполняют установочные скрипты многих дистрибутивов. К тому же способ установки из исходников универсален и подходит для всех Unix систем.
1. Скачиваем последнюю версию phpMyAdmin с официального сайта (на сегодняшний день последняя версия была 3.3.8).
2. Распаковываем скачанный архив в любую папку корневой директории нашего http сервера. Для условности пусть это будет папка phpmyadmin.
3. Находим в папке phpmyadmin/scripts файл create_tables.sql – это дамп таблицы phpmyadmin. Восстановим его командой от root или sudo


#mysql -u root -p < create_tables.sql

4. Заходим в консоль MySQL сервера и выставляем права на только что созданную базу данных phpmyadmin.


# mysql -u root -p
mysql> use phpmyadmin;
mysql> GRANT ALL ON phpmyadmin.* TO phpmyadmin@localhost IDENTIFIED BY 'your_password';
mysql> flush privileges;

5. Правим конфигурационный файл в корне папке phpmyadmin – config.sample.inc.php.
Переименовываем его в config.inc.php, выставляем владельцем файла того от кого работает сервер http (у меня это пользователь nobody) и выставляем права на файл 600 (эти действия выполняем от root или sudo)


#mv config.sample.inc.php config.inc.php
#chown nobody config.inc.php
#chmod 600 config.inc.php

В самом файле config.inc.php меняем значение строк – заносим пароль для авторизации через cookie и имя пользователя, пароль для восстановленной из дампа базы phpmyadmin.


$cfg['blowfish_secret'] = 'password';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'phpmyadmin';
$cfg['Servers'][$i]['controlpass'] = 'your_password';

а эти строки раскомментируем


/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

Теперь можно набирать в браузере http://localhost/phpmyadmin/ и авторизовываться.

Решение проблем при установке phpMyAdmin

1. При открытии браузером phpMyAdmin не открывается, а предлагает скачать страницу.
Решение – настроить поддержку php на http сервере. В apache модуль php подключается в httpd.conf строками,


LoadModule php5_module        modules/libphp5.so

само собой php должен быть установлен 🙂 После изменения httpd.conf перезагрузить apache сервер

2. При попытки авторизоваться возникает ошибка:
#2002 Невозможно подключиться к серверу MySQL
Решение – проверьте запущен ли MySQL сервер через консоль командой


mysql -u user -p

Если пользователь нормально авторизуется, то проверьте права на файл mysql.sock. Права на файл должны быть 777.

3. После авторизации возникает ошибка:
Невозможно загрузить расширение mcrypt! Проверьте настройки PHP.
Решение – убедитесь что в вашей системе установлено приложение mcrypt и библиотека libmcrypt, а модуль php для http сервера был собран с переменной


--with-mcrypt

4. После авторизации возникает ошибка:
При работе с многобайтными кодировками без установленного расширения PHP “mbstring”, phpMyAdmin не в состоянии производить корректное разбиение строк, что может привести к непредсказуемым результатам. Установите расширение PHP “mbstring”.
Решение – пересобрать модуль php для http сервера с параметром


--enable-mbstring

или раскомментировать в php.ini строку


extension=mbstring.so

5. После авторизации в phpMyAdmin видим предупредение:
При cookie-аутентификации, в конфигурационном файле необходимо задать парольную фразу установив значение директивы $cfg[‘blowfish_secret’].
Решение – в файле конфигурации phpMyAdmin – config.inc.php задать пароль в строке


$cfg['blowfish_secret']

6. После авторизации в phpMyAdmin видим предупредение:
Дополнительные возможности для работы со связанными таблицами недоступны. Для определения причины нажмите здесь.
Решение – либо не установлена база данных phpMyAdmin, либо не раскомментированы строки для этой базы в файле config.inc.php. Как это делать смотрите пункты 3,4,5 из установка из исходников

Если у вас есть или были другие ошибки при установке, настройке то прошу отписываться в комментах, будем дополнять..

Похожие статьи:

PHPMyAdmin — это удобный веб-интерфейс для управления базами данных MySQL. Он позволяет работать со всеми аспектами базы данных, включая создание таблиц, вставку и редактирование данных и т.д. Однако при установке вы можете столкнуться с некоторыми проблемами. В этом руководстве мы рассмотрим несколько наиболее распространенных проблем и предложим решения.

Ошибка «Unable to locate package phpmyadmin»

Часто возникает ошибка «Unable to locate package phpmyadmin», когда пытаетесь установить phpmyadmin на Ubuntu 22.04. Эта ошибка возникает из-за того, что пакет phpmyadmin не включен в официальный репозиторий Ubuntu 22.04. Чтобы решить эту проблему, выполните следующие шаги:

  1. Откройте терминал и выполните следующую команду:
sudo add-apt-repository universe
  1. Обновите список пакетов:
sudo apt update
  1. Установите phpmyadmin:
sudo apt install phpmyadmin

Ошибка «404 Not Found» при открытии phpmyadmin

Если вы столкнулись с ошибкой «404 Not Found» после установки phpmyadmin, это может быть вызвано несколькими причинами. Одной из них является неправильная настройка веб-сервера Apache.

Чтобы решить эту проблему, выполните следующие шаги:

  1. Откройте файл конфигурации Apache:
sudo nano /etc/apache2/apache2.conf
  1. Добавьте следующую строку в конец файла:
Include /etc/phpmyadmin/apache.conf
  1. Сохраните и закройте файл.

  2. Перезапустите Apache:

sudo service apache2 restart
  1. Теперь вы должны иметь доступ к phpmyadmin по адресу http://localhost/phpmyadmin/

Ошибка «Access denied»

Еще одна распространенная проблема — это ошибка «Access Denied» при попытке войти в phpmyadmin. Эта ошибка обычно вызвана неправильными учетными данными.

Для решения этой проблемы выполните следующие шаги:

  1. Откройте файл конфигурации phpmyadmin:
sudo nano /etc/phpmyadmin/config.inc.php
  1. Найдите строки с именем пользователя и паролем:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'password';
  1. Убедитесь, что имя пользователя и пароль правильные.

  2. Сохраните и закройте файл.

  3. Перезапустите Apache:

sudo service apache2 restart
  1. Теперь вы должны смочь войти в phpmyadmin с правильными учетными данными.

Это было руководство по устранению проблем с установкой и настройкой PHPMyAdmin на Ubuntu 22.04. Надеемся, что эта информация помогла вам решить ваши проблемы с PHPMyAdmin.

I tried to install phpMyAdmin on Ubuntu 16.04LTS, for MariaDB and Apache. The problem is that during the setup process, it asks me about ‘root’ name, but not for root’s password, and I end up with common ERROR 1045 (28000): Acces denied for user 'root'@'localhost' (using password: NO)

Lately I’ve reinstalled Apache and MariaDB, but I don’t know how to deal with this problem. I’ve already tried dpkg-reconfure dbconfig-common, and dpkg-reconfigure phpmyadmin, but every time this ERROR showed up.
Also, I know the root password, and I can normally log in with
mysql -u root -p, so the only question is how to give it to the phpmyadmin.

I checked my config.inc.php, but I can’t see any place to put either administrative user’s name or passowrd.

asked Feb 27, 2017 at 16:19

kwojt's user avatar

1

I fixed this issue by temporarily removing the root password.

Log into mysql using mysql -uroot -p.

Execute SET PASSWORD FOR root@localhost=PASSWORD(''); to remove the root password.

After that, execute dpkg-reconfigure phpmyadmin or re-install phpmyadmin, follow the installation as you normally would. Once that is done, run mysql_secure_installation again to set a root password again.

You can now log in with that password as root using phpmyadmin as normal.

answered Jan 1, 2018 at 10:40

confetti's user avatar

confetticonfetti

1,0622 gold badges12 silver badges27 bronze badges

2

I had the same problem in Ubuntu 20.04. However setting root password to empty with

ALTER USER 'root'@'localhost' IDENTIFIED BY '';

as suggested in other answer did not help. I was still getting the same error from the phpmyadmin setup. I chose the «ignore» option in that phpmyadmin setup dialog, and then manually created phpmyadmin database and user, and manually created tables as follows:

mysql> create database phpmyadmin;
mysql> create user 'phpmyadmin'@'localhost' identified by 'some_passwd';
mysql> grant all privileges on phpmyadmin.* to 'phpmyadmin'@'localhost';

Where ‘some_password’ was the same as I specified in the setup dialog and which in consequence was saved in /etc/phpmyadmin/config-db.php

Then I went to /usr/share/phpmyadmin/sql and ran

$ mysql -u phpmyadmin -p phpmyadmin < create_tables.sql

and specified that ‘some_password’. This made phpmyadmin happy and it started to work as expected.

I also needed to allow the webserver access to /usr/share/phpmyadmin in apache2 config, because the phpmyadmin setup failed to do that properly.

answered Nov 13, 2021 at 14:14

Palo's user avatar

PaloPalo

97412 silver badges27 bronze badges

1

The problem is not with the phpmyadmin package, which uses dbconfig-common to make the configuration. The Debian OS now has a new passwordless default for MariaDB (MySQL) to make it more secure:
https://github.com/ottok/mariadb-10.3/blob/master/debian/mariadb-server-10.3.README.Debian

So the problem occurs from dbconfig-common not knowing that we set a password for root. As seen in the README, we shouldn’t set one anyway, but add privileges to another user. The dbconfig-common package obviously uses the now obsolete file /etc/mysql/debian.cnf, which, as stated, by default lists the root user, but no password. If you add the password to the file, the installation of any package with dbconfig-common will work. It will also work without a root password.

answered Jul 21 at 11:36

Boyan Alexiev's user avatar

Whenever I try to install phpmyadmin on my ubuntu server 18.04 I get the following errors

sudo apt install phpmyadmin php-mbstring php-gettext
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package phpmyadmin
E: Unable to locate package php-mbstring
E: Unable to locate package php-gettext

Most threads I ca find suggest reupdating and upgrading using apt, but doing so doesn’t do anything, also I get that error on the fourth line

Err:5 http://ppa.launchpad.net/nijel/phpmyadmin/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:7 http://download.webmin.com/download/repository sarge Release
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/nijel/phpmyadmin/ubuntu bionic Release' does not have a Release file.

Can someone help with this?

asked Aug 5, 2018 at 8:11

newbieandroid's user avatar

2

On the Ubuntu Server 18.04 the list of apt sources is rather short and secure. If you want to install phpmyadmin or autossh or number of other packages which are not supported in main sources list, you should adjust the sources list.

$ sudo apt edit-sources

You can use the following list:

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse

More information can be found here:
handyman.dulare.com/ubuntu-18-04-bionic-unable-to-locate-package…

answered Aug 22, 2018 at 6:48

Paweł Dulak's user avatar

Paweł DulakPaweł Dulak

4013 silver badges2 bronze badges

Ubuntu 17

In this article, we will guide you through the process of troubleshooting and fixing issues related to phpMyAdmin not working on Ubuntu 22.04. This comprehensive guide is designed to help you understand the problem and provide you with detailed solutions to get your phpMyAdmin up and running again.

  1. Understanding the Problem
  2. Prerequisites
  3. Solution 1: Install the Correct PHP Module
  4. Solution 2: Check Apache Status
  5. Solution 3: Install the Correct PHP Module for Upgraded Systems
  6. Conclusion

Understanding the Problem

phpMyAdmin is a free and open-source tool written in PHP intended to handle the administration of MySQL or MariaDB with the use of a web browser. It can perform various tasks such as managing databases, tables, columns, relations, indexes, users, permissions, and so on.

Sometimes, after installing or upgrading Ubuntu, you might find that phpMyAdmin is not working as expected. This could be due to several reasons including Apache not running properly, missing or incompatible PHP modules, or configuration issues.

Prerequisites

Before we start, ensure you have sudo or root access to your Ubuntu 22.04 system. This is necessary to execute the commands that follow.

Solution 1: Install the Correct PHP Module

One of the most common reasons why phpMyAdmin might not work is because the required PHP module for Apache is not installed or is incompatible. To fix this, you need to install the libapache2-mod-php package for your PHP version.

To check your PHP version, run the following command:

php -v

This will display the PHP version you are currently using. For instance, if you are using PHP 8.1, you would need to install the corresponding package by running:

sudo apt install libapache2-mod-php8.1

This command uses the apt package handling utility to install the libapache2-mod-php8.1 package. The sudo command is used to run the command with root privileges.

After the installation, reload Apache with the following command:

sudo systemctl restart apache2

This command restarts the Apache service, making the new changes take effect.

Solution 2: Check Apache Status

Another common issue is that the Apache service is not running. To check the status of the Apache service, run the following command:

systemctl status apache2.service

This command displays the current status of the Apache service. If it’s not running, you can start it using:

sudo systemctl start apache2

Solution 3: Install the Correct PHP Module for Upgraded Systems

If you have recently upgraded from a previous version of Ubuntu, and the PHP version has changed, you might need to install the corresponding libapache2-mod-php package for your new PHP version.

For instance, if you have PHP 8.2 installed, you would need to install the corresponding package by running:

sudo apt install libapache2-mod-php8.2

Then, check if the module is enabled:

a2query -m php8.2

If it’s not enabled, you can enable it using:

sudo a2enmod php8.2

Finally, restart Apache:

sudo systemctl restart apache2

Conclusion

By following the above solutions, you should be able to fix the issue of phpMyAdmin not working on Ubuntu 22.04. If you continue to experience problems, please provide more information about your setup and any error messages you are encountering. Always remember to keep your system updated and install software from trusted sources to avoid such issues in the future.

To check the status of the Apache service, run the command systemctl status apache2.service. This will display the current status of the Apache service. If it’s not running, you can start it using sudo systemctl start apache2.

To install the correct PHP module for Apache, you need to know your PHP version. You can check your PHP version by running php -v. Once you know your PHP version, you can install the corresponding package using sudo apt install libapache2-mod-php<version>. For example, if you have PHP 8.1, you would run sudo apt install libapache2-mod-php8.1. After the installation, make sure to restart Apache with sudo systemctl restart apache2.

If you have recently upgraded from a previous version of Ubuntu and the PHP version has changed, you might need to install the corresponding libapache2-mod-php package for your new PHP version. First, determine your new PHP version by running php -v. Then, install the corresponding package using sudo apt install libapache2-mod-php<version>. For example, if you have PHP 8.2 installed, you would run sudo apt install libapache2-mod-php8.2. Finally, enable the module if necessary with sudo a2enmod php<version> and restart Apache with sudo systemctl restart apache2.

If none of the above solutions work, please provide more information about your setup and any error messages you are encountering. This will help in diagnosing the issue and providing a more specific solution. Additionally, make sure your system is updated and you are installing software from trusted sources to avoid compatibility issues.

Понравилась статья? Поделить с друзьями:
  • Ошибка при удалении питона 0x80070643
  • Ошибка при стресс тесте кэша
  • Ошибка при создании класса поставщика теневого копирования
  • Ошибка при проверке подписи честный знак
  • Ошибка при установке photoshop требуется обновление системы