- 1. 安装 php
- 2. 安装 epel
- 3. 安装 phpMyAdmin
- 4. 修改配置文件
- phpMyAdmin - Web based MySQL browser written in php
- Allows only localhost by default
- But allowing phpMyAdmin to anyone other than localhost should be considered
- dangerous unless properly secured by SSL
- These directories do not require access over HTTP - taken from the original
- phpMyAdmin upstream tarball
- This configuration prevents mod_security at phpMyAdmin directories from
- filtering SQL etc. This may break your mod_security implementation.
- SecRuleInheritance Off
1. 安装 php
yum install php
2. 安装 epel
yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
3. 安装 phpMyAdmin
yum install phpmyadmin
4. 修改配置文件
vim /etc/httpd/conf.d/phpMyAdmin.conf
- 将
Require ip xxx
修改为Require all granted
,共4处需要修改,修改后文件如下: ```phpMyAdmin - Web based MySQL browser written in php
Allows only localhost by default
#But allowing phpMyAdmin to anyone other than localhost should be considered
dangerous unless properly secured by SSL
Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin
These directories do not require access over HTTP - taken from the original
phpMyAdmin upstream tarball
#
This configuration prevents mod_security at phpMyAdmin directories from
filtering SQL etc. This may break your mod_security implementation.
#
SecRuleInheritance Off
<a name="4be012cf"></a>
#### 5. 修改数据库的配置
```shell
vim /etc/phpMyAdmin/config.inc.php
- 修改文件中对应的配置即可。
- 假如需要配置多个数据库连接,只需要添加多套配置即可。
$i++; $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['port'] = '3307'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['user'] = ''; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['bs_garbage_threshold'] = 50; $cfg['Servers'][$i]['bs_repository_threshold'] = '32M'; $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600; $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
6. 重启服务
systemctl restart httpd
7. 访问
http://ip/phpmyadmin
8. phpMyAdmin 默认安装位置
/usr/share/phpMyAdmin