---
title: "centos7 phpmyadmin mysql"
author: "xkorey"
date: "2014-09-19T16:00:20Z"
tags: ["MySQL", "phpMyAdmin"]
categories: ["操作系统"]
slug: "centos7-phpmyadmin-mysql"
draft: false
lastmod: "2014-09-23T16:07:49Z"
id: 2118271
url: "https://xkorey.iteye.com/blog/2118271"
---

参考链接：\[url]http://www.howtoforge.com/apache\_php\_mysql\_on\_centos\_7\_lamp\[/url] rpm \[code="link"] rpm -ivh http://dl.fedoraproject.org/pub/epel/beta/7/x86\_64/epel-release-7-1.noarch.rpm \[/code] 安装mysql \[code="shell"] yum -y install mariadb-server mariadb systemctl start mariadb.service systemctl enable mariadb.service mysql\_secure\_installation \[/code] 安装httpd \[code="shell"] yum -y install httpd systemctl start httpd.service firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload \[/code] 安装php \[code="shell"] yum -y install php systemctl restart httpd.service \[/code] 安装php-mysql 选择适合本机的php-mysql \[code="shell"] yum search php \[/code] 搜索的结果 \[code="shell"] ============================ N/S matched: php-mysql ============================ php-mysql.x86\_64 : A module for PHP applications that use MySQL databases php-mysqlnd.x86\_64 : A module for PHP applications that use MySQL databases Name and summary matches only, use "search all" for everything. \[/code] 我选的是php-mysql.x86\_64 \[code="shell"] yum -y install php-mysql.x86\_64 \[/code] 安装php模块 \[code="shell"] yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel systemctl restart httpd.service \[/code] 安装phpmyadmin \[code="shell"] yum install phpMyAdmin \[/code] 修改配置文件 \[code="shell"] vi /etc/httpd/conf.d/phpMyAdmin.conf \[/code] 将默认的配置注释掉 \[code="shell"] Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin # # # # Apache 2.4 # # Require ip 127.0.0.1 # Require ip ::1 # # # # # Apache 2.2 # Order Deny,Allow # Deny from All # Allow from 127.0.0.1 # Allow from ::1 # # \[/code] 添加新的 \[code="shell"] Options none AllowOverride Limit Require all granted \[/code] 重启httpd \[code="shell"] systemctl restart httpd.service \[/code] 现在phpmyadmin应该安装完成了。 可以访问http://localhost/phpmyadmin 了。