PhpMyAdmin is written in PHP and can be used to control and operate MySQL databases on the web. PhpMyAdmin can be used to operate databases, such as creating, copying, and deleting data.
1. Install phpMyAdmin. You can use the centos epel software source to conveniently install the phpMyAdmin package:
[Root @ centos-server ~] $ YumInstallPhpMyAdmin
After phpMyAdmin is installedProgramThe file is in the/usr/share/phpMyAdmin directory, and the corresponding httpd configuration file is in/etc/httpd/CONF. d/phpMyAdmin. conf.
2. Configure/etc/httpd/CONF. d/phpMyAdmin. conf. By default, phpMyAdmin does not allow remote access from hosts except localhost:
<Directory/usr/share/PHPmyAdmin/> <ifmodule mod_authz_core.c># Apache2.4<Requireany>Require IP127.0.0.1Require IP ::1</Requireany> </ifmodule> <ifmodule! Mod_authz_core.c># Apache2.2Order deny, allow deny from all allow from127.0.0.1Allow from ::1</Ifmodule> </directory>
To remotely access phpMyAdmin, you can modify the above content:
<Directory/usr/share/PHPmyAdmin/> <ifmodule! Mod_authz_core.c># Apache2.2Order allow, deny allow from all</Ifmodule> </directory>
3. Go to the/usr/share/phpMyAdmin directory and create the config. Inc. php file:
[Root @ centos-server/usr/share/phpMyAdmin] $CPConfig. sample. Inc. php config. Inc. php
4. Restart the HTTPd service:
[Root @ centos-server ~] $ Service httpd restart
5. OK. Open the website http: // 192.168.12.215/phpMyAdmin (the server address is http: // 192.168.12.215). Enter the MySQL account and password and you will see the phpMyAdmin homepage.