First, the preparatory work:
1. If MySQL root account is empty, you need to set the root password
CentOS under the default installed MySQL server, inside the root account default password is empty, first set a password for root
#mysqladmin-u root password yourpassword
* Note: Although some special configuration can make phpMyAdmin allow null password login, but do not recommend this, especially the public network of servers.
2. Set PHP.ini to properly configure Session.save_path
1). First check the php.ini configuration file
#grep Session.save_path/etc/php.ini
If the following settings are not present, increase the configuration. If it is commented, remove the annotation
Session.save_path = "/var/lib/php/session"
2). See if the directory exists:
If it does not exist, it is created manually
#mkdir/var/lib/php/session
# Modify directory owner for Nginx
Chown Nginx:nginx session/-R
# Reboot Start PHP-FPM
Second, install the configuration phpMyAdmin
1. Download and extract to phpMyAdmin
Official download page: http://www.phpmyadmin.net/home_page/downloads.php
(Chinese users should choose to download all-languages version)
After the download is complete, unpack:
Unzip Phpmyadmin-4.1.12-all-languages.zip
Move to the appropriate directory location and change to a name that is easy to access:
MV Phpmyadmin-4.1.12-all-languages/www/phpmyadmin
2. Configure phpMyAdmin
To copy a configuration file:
#cd/www/phpmyadmin
#cp config.sample.inc.php config.inc.php
Set a secret key for internal use (related to internal encryption, no direct relationship to page login)
$cfg [' blowfish_secret '] = ' www.tudaxia.com ';
Third, configure the site under Nignx
Vi/etc/nginx/conf.d/phpmyadmin.conf
server {
listen 8081;
server_name localhost;
Access_log/var/log/nginx/phpmyadmin-access.log main;
Location/{
root/www/phpmyadmin;
Index index.php;
}
Location ~ \.php$ {
root/www/phpmyadmin;
Fastcgi_pass Unix:/var/run/php-fpm/php-fpm.sock;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}
Location ~/\.ht {
deny all;
}
}
Reboot Nginx:
Complete installation, Access http://yourserver:8081/, test phpMyAdmin.
Four, the phpmyadmin load slow to solve the method
The final reason for the slow loading of the phpmyadmin4.0 series is that recently phpMyAdmin's website is often not open, and the phpMyAdmin page will automatically check the official online version of the program update, So when you go into the phpMyAdmin Admin page and click on the database, phpMyAdmin has been trying to connect to the website to slow down the entire opening process.
The final solution is to not let phpMyAdmin check the update, find the phpMyAdmin directory version_check.php files, specific modifications as follows:
if (Isset ($_session[' cache '] [' Version_check '])
&& time () < $_session[' Cache '] [' version_check '] [' Timestamp '] + 3600 * 6
) {
$save = false;
$response = $_session[' cache '] [' version_check '] [' response '];
} else {
// $save = true; $file = ' Http://www.phpmyadmin.net/home_page/version.json '; if (ini_get (' Allow_url_fopen ')) {
// $response = file_get_contents ($file); Else if (function_exists (' Curl_init ')) {
// $curl _handle = Curl_init ($file); curl_setopt ($curl _handle, Curlopt_returntransfer, 1); $response = curl_exec ($curl _handle);
// }
}
The above code is by annotating the else{...} The middle section to cancel phpMyAdmin Connection official website Version.json to check the update
After the modification, phpMyAdmin immediately returned to the second open.