phpMyAdmin
phpMyAdmin is a web-based tool to help manage MariaDB or MySQL databases, written primarily in PHP and distributed under the GNU GPL.
Installation
Running
Make sure the PHP mariadb and iconv extensions have been enabled.
Optionally you can enable extension=bz2 and extension=zip for compression support.
Apache
Set up Apache to use PHP as outlined in the Apache HTTP Server#PHP article.
Create the Apache configuration file:
And include it in /etc/httpd/conf/httpd.conf :
After making changes to the Apache configuration file, restart httpd.service .
Lighttpd
Configuring Lighttpd, make sure it is able to serve PHP files and mod_alias has been enabled.
Add the following alias for PhpMyAdmin to the config:
Nginx
Make sure to set up nginx#FastCGI and use nginx#Server blocks to make management easier.
By preference, access phpMyAdmin by subdomain, e.g. https://pma.domain.tld :
Or by subdirectory, e.g. https://domain.tld/phpMyAdmin :
Configuration
The main configuration file is located at /usr/share/webapps/phpMyAdmin/config.inc.php .
Define a remote MySQL server
If the MySQL server is a remote host, append the following line to the configuration file:
Using setup script
To allow the usage of the phpMyAdmin setup script (e.g. http://localhost/phpmyadmin/setup), make sure /usr/share/webapps/phpMyAdmin is writable for the http user:
Add blowfish_secret passphrase
It is required to enter a unique 32 characters long string to fully use the blowfish algorithm used by phpMyAdmin, thus preventing the message ERROR: The configuration file now needs a secret passphrase (blowfish_secret):
Enabling Configuration Storage
Extra options such as table linking, change tracking, PDF creation, and bookmarking queries are disabled by default, displaying The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. on the homepage.
In /usr/share/webapps/phpMyAdmin/config.inc.php , uncomment (remove the leading «//»s), and change them to your desired credentials if needed:
Setup database
Two options are available to create the required tables:
- Import /usr/share/webapps/phpMyAdmin/sql/create_tables.sql by using PhpMyAdmin.
- Execute mysql -u root -p < /usr/share/webapps/phpMyAdmin/sql/create_tables.sql in the command line.
Setup database user
To apply the required permissions for controluser , execute the following query:
In order use the bookmark and relation features, set the following permissions:
Re-login to ensure the new features are activated.
Enabling template caching
Edit /usr/share/webapps/phpMyAdmin/config.inc.php to add the line:
Remove config directory
Remove temporary configuration directory once configuration is done. This will also suppress warning from web interface:
Install themes
Themes are located in /usr/share/webapps/phpMyAdmin/themes . You can find new themes in https://www.phpmyadmin.net/themes/
You can simply download and extract the new theme and it will work after phpmyadmin refresh. However, you have to download theme for the correct version of phpmyadmin, themes for older versions will not work.
phpMyAdmin
phpMyAdmin — это LAMP приложение, созданное специально для администрирования MySQL серверов. Написанный на PHP и доступный через web обозреватель, phpMyAdmin предоставляет графический интерфейс для задач администрирования баз данных.
Установка
Перед установкой phpMyAdmin вам потребуется доступ к базе MySQL на том же самом компьютере, где вы устанавливаете phpMyAdmin, либо на удаленном компьютере, доступным по сети. Подробности смотрите в разделе MySQL. Для установки в терминале введите:
По запросу выберите какой web сервер будет настроен для phpMyAdmin. В этом разделе предполагается использование в качестве web сервера Apache2.
Далее производим настройку apache для обеспечения работы phpMyAdmin.
Начиная с ubuntu 13.10 необходимо выполнить команды в терминале:
В обозревателе перейдите по адресу http://localhost/phpmyadmin . На странице входа введите root в качестве имени пользователя, или другого пользователя, если вы его настраивали, а также пароль этого пользователя MySQL.
После этого попробуйте снова войти через браузер.
Как только вы авторизуетесь, вы сможете при необходимости сменить пароль пользователя root, создавать пользователей, создавать/удалять базы данных, таблицы и пр.
Настройка
Файлы настройки phpMyAdmin находятся в /etc/phpmyadmin. Основной файл настроек — это /etc/phpmyadmin/config.inc.php. Этот файл содержит опции настройки, которые применяются к phpMyAdmin глобально.
Чтобы использовать phpMyAdmin для управления MySQL на другом сервере, настройте следующую запись в /etc/phpmyadmin/config.inc.php:
После настройки выйдите из phpMyAdmin и зайдите снова и вы получите доступ к новому серверу.
Файлы config.header.inc.php и config.footer.inc.php используются для добавления HTML верхнего и нижнего заголовков для phpMyAdmin.
Другим важным файлом настройки является /etc/phpmyadmin/apache.conf, который является символьной ссылкой на /etc/apache2/conf.d/phpmyadmin.conf и используется для настройки Apache2 по обслуживанию сайта phpMyAdmin. Файл содержит настройки по загрузке PHP , правам доступа к каталогу и пр. Для дополнительной информации смотрите раздел HTTPD — Apache2 интернет сервер.
Ограничить видимость для интернета
в файл /etc/apache2/conf-enabled/phpmyadmin.conf под строчкой
Ссылки
Документация по phpMyAdmin устанавливается из пакета и доступна по ссылке phpMyAdmin Documentation (знак вопроса в обрамлении) под логотипом phpMyAdmin. Официальная документация также доступна на сайте phpMyAdmin.
phpmyadmin is working fine but I can't find config.inc.php file?
Now I wanted to change some settings and so I looked for the config.inc.php file in the phpmyadmin directory but it’s not there?
I have a config.sample.inc.php but obviously it’s just a sample
I did a search and the only config.inc.php file is in the /setup/frames/ folder which is clearly not the main config file.
So where is it? I installed phpmyadmin last month and I think I just copied it to my htdocs folder, nothing special, but I can’t remember if I did something different.
Name already in use
phpmyadmin / doc / config.rst
- Go to file T
- Go to line L
- Copy path
- Copy permalink
- Open with Desktop
- View raw
- Copy raw contents Copy raw contents
Copy raw contents
Copy raw contents
All configurable data is placed in :file:`config.inc.php` in phpMyAdmin’s toplevel directory. If this file does not exist, please refer to the :ref:`setup` section to create one. This file only needs to contain the parameters you want to change from their corresponding default value.
If a directive is missing from your file, you can just add another line with the file. This file is for over-writing the defaults; if you wish to use the default value there’s no need to add a line here.
The parameters which relate to design (like colors) are placed in :file:`themes/themename/scss/_variables.scss` . You might also want to create :file:`config.footer.inc.php` and :file:`config.header.inc.php` files to add your site specific code to be included on start and end of each page.
Some distributions (eg. Debian or Ubuntu) store :file:`config.inc.php` in /etc/phpmyadmin instead of within phpMyAdmin sources.
Server connection settings
Cookie authentication options
Navigation panel setup
Export and import settings
Tabs display settings
Web server settings
SQL query box settings
Web server upload/save/import directories
If PHP is running in safe mode, all directories must be owned by the same user as the owner of the phpMyAdmin scripts.
If the directory where phpMyAdmin is installed is subject to an open_basedir restriction, you need to create a temporary directory in some directory accessible by the PHP interpreter.
For security reasons, all directories should be outside the tree published by webserver. If you cannot avoid having this directory published by webserver, limit access to it either by web server configuration (for example using .htaccess or web.config files) or place at least an empty :file:`index.html` file there, so that directory listing is not possible. However as long as the directory is accessible by web server, an attacker can guess filenames to download the files.
Various display setting
The page title displayed by your browser’s window or tab title bar can be customized. You can use :ref:`faq6_27` . The following four options allow customizing various parts of the phpMyAdmin interface. Note that the login page title cannot be changed.