PMA網站
http://www.phpmyadmin.net/home_page/downloads.phpphp
一.安裝Phpmyadmin-4.0.10.20mysql
[root@Zabbixserver shenjianyu]# pwd
/home/shenjianyusql
[root@Zabbixserver shenjianyu]# tar -zxvf phpMyAdmin-4.0.10.20-all-languages.tar.gz數據庫
[root@Zabbixserver shenjianyu]# cp -rp phpMyAdmin-4.0.10.20-all-languages /var/www/pma (前提:要安裝Apache)apache
[root@Zabbixserver shenjianyu]# cd /var/www/pma/vim
若是你下載的是最新版本,須要作這一步,我暫時沒有作瀏覽器
[root@Zabbixserver pma]# cp config.sample.inc.php config.inc.php安全
新版本的PhpMyAdmin 加強了安全性,須要在配置文件設置一個短語密碼。
不然進入以後會有「配置文件如今須要一個短語密碼。」的紅色警嘆提示
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['blowfish_secret'] = 'abcde';(其中的"abcde"自定義)
這個密碼用於Cookies的加密,以避免多個PhpMyAdmin或者和其餘程序共用Cookies時搞混cookie
二.配置Apacheide
配置apache,加入以下配置
[root@Zabbixserver pma]# vim /etc/httpd/conf/httpd.conf
Alias /pma "/var/www/pma/" < Directory "/var/www/pma/"> Order allow,deny Allow from all Options -Indexes FollowSymLinks AllowOverride All < /Directory>
新建一個帶密碼的本地帳戶
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY "123456" WITH GRANT OPTION;
三.排錯
①通常安裝完,會有這個提示
解決辦法:
[root@Zabbixserver php.d]# yum install php-mbstring
[root@Zabbixserver php.d]# /etc/init.d/httpd stop
[root@Zabbixserver php.d]# /etc/init.d/httpd start
②
提示「沒法載入mcrypt擴展,請檢查PHP配置」
網上的辦法無非就是重裝下php 帶上 --with-mcrypt參數
可是總覺得這種方法太笨重
因此仔細看了php官方網站,找到了用phpize來安裝mcrypt
You can install Mcrypt from the PHP Source Tree as a module if you choose.
You first need to ensure you have libmcrypt, libmcrypt-devel, and mcrypt installed, then do:
[root@Zabbixserver pma]# cd /shenjianyu/php-5.5.35/ext/mcrypt/
[root@Zabbixserver pma]# phpize ( 若是沒有這個命令,yum install php-devel.i686 )
[root@Zabbixserver ext]# whereis phpize
phpize: /usr/bin/phpize /usr/share/man/man1/phpize.1.gz
[root@Zabbixserver mcrypt]# phpize
[root@Zabbixserver mcrypt]# aclocal
[root@Zabbixserver mcrypt]# ./configure
[root@Zabbixserver mcrypt]# make && make install
若是make時報錯:
/bin/sh /shenjianyu/php-5.5.35/ext/mcrypt/libtool --mode=compile cc -I. -I/shenjianyu/php-5.5.35/ext/mcrypt -DPHP_ATOM_INC -I/shenjianyu/php-5.5.35/ext/mcrypt/include -I/shenjianyu/php-5.5.35/ext/mcrypt/main -I/shenjianyu/php-5.5.35/ext/mcrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /shenjianyu/php-5.5.35/ext/mcrypt/mcrypt.c -o mcrypt.lo libtool: compile: cc -I. -I/shenjianyu/php-5.5.35/ext/mcrypt -DPHP_ATOM_INC -I/shenjianyu/php-5.5.35/ext/mcrypt/include -I/shenjianyu/php-5.5.35/ext/mcrypt/main -I/shenjianyu/php-5.5.35/ext/mcrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /shenjianyu/php-5.5.35/ext/mcrypt/mcrypt.c -fPIC -DPIC -o .libs/mcrypt.o /shenjianyu/php-5.5.35/ext/mcrypt/mcrypt.c:283: error: ‘PHP_FE_END’ undeclared here (not in a function) ‘PHP_FE_END’未聲明(不在函數內) -----{error: ‘PHP_FE_END’ undeclared here (not in a function)}
解決方法: 源代碼有錯誤,進入PHP-5.3.18/ext/mcrypt目錄
sed -i 's|PHP_FE_END|{NULL,NULL,NULL}|' ./*.c sed -i 's|ZEND_MOD_END|{NULL,NULL,NULL}|' ./*.c
再從新make && make install
若是提示:
Enable the module by adding: 'extension=mcrypt.so' to PHP.ini.
Done!
那就是成功了
# vi /etc/php.ini
搜索[mcrypt]
在這行下添加
extension=mcrypt.so
# service httpd restart
若是出錯將全部httpd進程killall httpd後,再開啟
在瀏覽器輸入http://IP/pma
輸入以前受權的數據庫帳號 密碼便可
若是想要經過phpMyAdmin查看其餘機器數據庫
1.先在對應機器上受權你server ip的帳號密碼
2.修改/var/www/pma/config.inc.php的這一行
$cfg['Servers'][$i]['host'] = '192.168.1.185';
重啓便可