The original is installed on CentOS 7 phpMyAdmin
phpMyAdmin is a PHP-based, Web MYSQL/MARIADB database management tool. Although there are already some lightweight database management tools such as Adminer, phpMyAdmin is more widely used by webmasters to perform various mysql/mariadb management tasks. It supports almost all MySQL database/table related operations, such as browse, create, copy, delete, rename, change, and MySQL user/Rights Management and database import/export. Here's how to install PhpMyAdmin on CentOS 6 or 7 .
If you install PhpMyAdmin on CentOS , you first need to set up a Web server (such as Apache or Nginx), install the MYSQL/MARIADB database and PHP. Depending on your preferences and needs, you can choose an installation from lamp and lemp.
Another requirement is to allow the Epel library to be installed on your centos. If you haven't set it up, please poke here.
Install phpMyAdmin on CentOS6 or 7 once you have set up the Epel library, you can easily install phpMyAdmin with the following command .
on CentOS 7:
- $ sudo yum install phpMyAdmin
on CentOS 7:
- $ sudo yum install phpmyadmin php-mcrypt
Configuring phpMyAdmin on CentOS 7 by default,phpMyAdmin on CentOS 7 only allows access from the loopback address (127.0.0.1). In order to be able to connect remotely, you need to change its configuration.
Open The phpMyAdmin configuration file (path:/etc/httpd/conf.d/phpmyadmin.conf) with a text editorand locate and comment out the line of code with the word "Require IP XXXX". There will be lines of code like this, with "Require all granted" instead. The re-altered configuration file is shown below.
- $ sudo 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>
- . . . . .
Finally, restart the httpd for the changes to take effect.
- $ sudo systemctl restart httpd
Configuring phpMyAdmin on CentOS 6 by default, phpMyAdmin on CentOS 6 is prohibited from being accessed from each IP address. In order to be able to connect remotely, you need to change its configuration.
Open the PhpMyAdmin configuration file (path:/etc/httpd/conf.d/phpmyadmin.conf) with a text editor and locate and comment out the line of code for the word "Deny from all". Then change the line of code from 127.0.0.1″ to allow from 0.0.0.0″. The re-altered configuration file is shown below.
- $ sudo vi /etc/httpd/conf. D/phpmyadmin. conf
- <directory "/usr/share/phpmyadmin">
- Order Deny,allow
- # Deny from all
- Allow from 0.0.0.0
- </Directory>
The next step is to encrypt the phpMyAdmin configuration file with the Blowfish encryption tool. This step requires the password in the encrypted cookie to be part of the cookie-based authentication.
Open the file shown in the following path with a text editor and set a random password with Blowfish, as shown below.
- $ sudo vi /usr/share/phpmyadmin/config. Inc. PHP
- $cfg[' Blowfish_secret '] = ' kd5g}d33axdc50! ' ; / * must FILL in the This for COOKIE auth! */
Finally, restart the httpd for the changes to take effect.
- $ sudo service httpd restart
To test whether the phpMyAdmin test phpMyAdmin is set successfully, visit this page: Http:///phpmyadmin
You should be able to record any MySQL user (such as root) and manage MYSQL/MARIADB database/table through the Web interface.
Troubleshooting There are some problem solving methods that are encountered during the installation of phpMyAdmin on CentOS.
When you try to connect the phpMyAdmin page in your browser, you see "403 Forbidding" error:
You don't have permission to access/phpmyadmin on this server.
This error occurs because the IP address remote connection is blocked by the phpMyAdmin by default. To fix this error, you need to edit its configuration file to allow remote connections. See above for specific operation.
When you connect the phpMyAdmin page, you see "The configuration file now needs a secret passphrase (Blowfish_secret)." Information, and you cannot log in.
To fix this error, you need to edit/usr/share/phpmyadmin/config.inc.php this file to add a random blowfish password, and then restart httpd as shown below.
- $cfg[' Blowfish_secret '] = ' kd5g}d33axdc50! ' ; / * must FILL in the This for COOKIE auth! */
- $ sudo service httpd restart (CentOS 6)$ sudo systemctl restart httpd (centos 7)
When you connect the phpMyAdmin page, you see "Cannot load mcrypt extension. Please check your PHP configuration "error message.
To fix this error, install the following package:
- $ sudo yum install php-mcrypt
Then restart HTTPD:
- $ sudo service httpd restart (centos 6)$ sudo systemctl restart httpd (centos 7 )
Installing phpMyAdmin on CentOS 7