基于Centos7来实现(新版本的phpMyAdmin可能要依赖新版本的php程序)

一、安装lamp:

yum install -y php php-mysql mariadb-server

 

systemctl start mariadb.service

systemctl start httpd.service

 

 

二、创建数据库管理员:

mysql

SET PASSWORD FOR 'root'@'localhost'=PASSWORD('12345');

SET PASSWORD FOR 'root'@'127.0.0.1'=PASSWORD('12345');

//给root设置密码

 

FLUSH PRIVILEGES;    //刷新

exit           //退出mysql

 

 

三、部署phpMyAdmin:

1.准备程序包

部署phpMyAdmin_部署

unzip phpMyAdmin-4.0.10.18-all-languages.zip

 

mkdir /www

cp -a phpMyAdmin-4.0.10.18-all-languages /www/

ln -s /www/phpMyAdmin-4.0.10.18-all-languages//www/phpMyAdmin

//给程序包创建软链接,方便以后升级用

部署phpMyAdmin_部署_02

 

 

2.    修改配置文件

cp /www/phpMyAdmin/{config.sample.inc.php,config.inc.php}

//复制模板文件

 

vim /www/phpMyAdmin/config.inc.php

部署phpMyAdmin_MyAdmin_03

 

 

3.    添加虚拟主机

vim /etc/httpd/conf.d/db.conf

部署phpMyAdmin_部署_04

 

部署phpMyAdmin_部署_05

 

httpd -t

systemctl reload httpd.service

 

 

4.    登录phpMyAdmin进一步配置

部署phpMyAdmin_MyAdmin_06

 

yum install -y php-mbstring

systemctl reload httpd.service

 

部署phpMyAdmin_MyAdmin_07