Objective
phpMyAdmin is a web-based management tool for managing MySQL.
One. Download and configure the phpMyAdmin1. Download phpMyAdmin Package
~]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.tar.gz
2. Modify the configuration file:
Expand Packages
~]# tar xf tar xf phpmyadmin-4.0.10.20-all-languages.tar.gz-c/opt
~]# cd/opt
opt]# LN-SV Phpmyadmin-4.0.10.20-all-languages/phpmyadmin
Generate Random string
~]# OpenSSL Rand-hex 16
dd139c3092a3ea7e8909325386656363
~]# cp/opt/phpmyadmin/conf.simple.inc.php/opt/phpmyadmin/conf.inc.php
~]# vim/opt/phpmyadmin/conf.inc.php
$cfg [' blowfish_secret '] = ' 53a2d0539062db50ff4406176ab2faad ';
$cfg [' Servers '] [$i] [' host '] = ' 192.168.196.220 ';
The first configuration is used for cookie authentication; The second parameter is used to set up a MySQL host that needs to be managed.
Two. Configure PHP1. Installing a dependent Package
~]# yum-y Install php php-mysql php-mbstring php-mcrypt php-fpm
2. Start the service
~]# Service PHP-FPM Start
Three. Configure NGINX1. Modifying a configuration file
~]# vim/etc/nginx/conf.d/default.conf
server { ... location /phpMyAdmin { index index.php; root /opt/phpMyAdmin; location ~ \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$script_script_name; include fastcgi_params; } } ...}
Yes, it can be accessed through http://IP/phpMyAdmin.
2. Reload the configuration file
~]# nginx-t Check grammar
~]# nginx-s Reload Reload configuration file
Four. Assigning MySQL account
Mysql> GRANT all on . To ' php_user ' @ ' 192.168.% ' identified by ' php_pass ';
This command runs on MySQL that needs to be managed. This user name and password are logged in as the user name and password.
Five. Login
PHP connection to MySQL drive, not installed, PHP can not connect to MySQL.
Error 1 encountered. Php-mbstring Package not installed
2. Php-mysql not installed
Resources
PHP configuration file Description: Https://docs.phpmyadmin.net/zh_CN/latest/setup.html#quick-install
Installing the phpMyAdmin tool