使用yum安装phpmyadmin yum install phpmyadmin php-mcrypt phpMyAdmin 的默认安装目录是 /usr/share/phpMyAdmin,同时会在 A
使用yum安装phpmyadmin
yum install phpmyadmin php-mcrypt
phpMyAdmin 的默认安装目录是 /usr/share/phpMyAdmin,同时会在 Apache 的配置文件目录中自动创建虚拟主机配置文件 /etc/httpd/conf.d/phpMyAdmin.conf(区分大小写)。默认情况下,CentOS 7上的phpMyAdmin只允许从回环地址(127.0.0.1)访问。为了能远程连接,你需要改动它的配置。
vi /etc/httpd/conf.d/phpMyAdmin.conf
修改配置文件,如下:
<Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> # Require ip 127.0.0.1 #注释掉 # Require ip ::1 #注释掉 Require all granted #新添加 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule></Directory><Directory /usr/share/phpMyAdmin/setup/> <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> #Require ip 127.0.0.1 #注释掉 #Require ip ::1 #注释掉 Require all granted #新添加 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule></Directory>
然后重启Apache服务器
systemctl restart httpd
然后就可以通过浏览器访问http://服务器ip地址/phpmyadmin访问
访问phpmyadmin页面
文/TyiMan(简书作者)
原文链接:http://www.jianshu.com/p/bc14ff0ab1c7
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。