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';
重启便可