Getting started with Linux: Installing phpMyAdmin on CentOS

Source: Internet
Author: User
PhpMyAdmin is a Web-based MySQLMariaDB database management tool based on PHP. Although some lightweight database management tools such as Adminer already exist,

PhpMyAdmin is a Web-based MySQL/MariaDB database management tool based on PHP. Although some lightweight database management tools such as Adminer already exist,

Problem: I am running a MySQL/MariaDB service on CentOS, and I want to use phpMyAdmin to manage databases through network interfaces. What is the best method for installing phpMyAdmin on CentOS?

PhpMyAdmin is a Web-based MySQL/MariaDB database management tool based on PHP. Although some lightweight database management tools such as Adminer already exist, phpMyAdmin is more widely used in website administrators to manage various MySQL/MariaDB tasks. It supports almost all MySQL database/table related operations, such as browsing, creating, copying, deleting, renaming, and changing, as well as MySQL user/permission management and database import/export. The following describes how to install phpMyAdmin on CentOS 6 or 7.

Prerequisites

To install phpMyAdmin on CentOS, set up a Web server (such as Apache or nginx) and install MySQL/MariaDB and PHP. Depending on your preferences and needs, you can select an installation from LAMP and LEMP.

Install and configure LAMP in CentOS 6.5

Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)

Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind

Build a WEB Server Linux + Apache + MySQL + PHP in the LAMP source code Environment

Ubuntu-based LAMP optimization and Reinforcement

Another requirement is to allow the EPEL library to be installed on your CentOS. If you have not set it, click here.

Install phpMyAdmin on CentOS6 or 7

Once you have set the EPEL library, you can easily use the following command to install phpMyAdmin.

On CentOS 7:

  • $ Sudo yum install phpmyadmin
  • On CentOS 7:

    Configure phpMyAdmin on CentOS 7

    By default, phpMyAdmin on CentOS 7 can only be accessed from the loop address (127.0.0.1. To be able to connect remotely, You need to modify its configuration.

    Open the phpMyAdmin configuration file (Path:/etc/httpd/conf. d/phpMyAdmin. conf) in the text editor, and find and comment out the code lines with the words "Require ip XXXX. There will be four such lines of code, replaced by "Require all granted. The modified configuration file is as follows.

    Finally, restart httpd to make the change take effect.

  • $ Sudo systemctl restart httpd
  • Configure phpMyAdmin on CentOS 6

    By default, phpMyAdmin on CentOS 6 prohibits access from each IP address. To be able to connect remotely, You need to modify its configuration.

    Open the phpMyAdmin configuration file (Path:/etc/httpd/conf. d/phpMyAdmin. conf) in the text editor, and find and comment out the code line "Deny from all. Then, change the code line "Allow from 127.0.0.1" to "Allow from 0.0.0.0 ". The modified configuration file is as follows.

    The next step is to encrypt the phpMyAdmin configuration file with the blowfish encryption tool. This step requires encryption of the password in the cookie as part of the cookie-based authentication.

    Open the file shown in the following path in the text editor and use blowfish to set a random password, as shown below.

    Finally, restart httpd to make the change take effect.

  • $ Sudo service httpd restart
  • Test phpMyAdmin

    Test whether phpMyAdmin is set successfully. Visit this page: /Phpmyadmin

    You should be able to record any MySQL users (such as root) and manage MySQL/MariaDB databases/tables through the Web interface.

    Troubleshooting

    Here are some solutions to problems encountered when installing phpMyAdmin on CentOS.

  • When you try to connect to the phpMyAdmin page in your browser, you will see the "403 Forbidding" error:

    You don't have permission to access/phpMyAdmin on this server.

    This error occurs because phpMyAdmin blocks the remote connection from the IP address by default. To fix this problem, you need to edit its configuration file to allow remote connection. For more information, see.

  • When you connect to The phpMyAdmin page, you can see The information "The configuration file now needs a secret passphrase (blowfish_secret)." And you cannot log on.

    To fix this problem, you need to edit the/usr/share/phpmyadmin/config. inc. php file to add a random blowfish password and restart httpd, as shown below.

  • When you connect to the phpMyAdmin page, you will see the "Cannot load mcrypt extension. Please check your PHP configuration" error message.

    To fix this problem, install the following package:

    Restart httpd:

  • Example of LAMP architecture collaborative application-phpMyAdmin

    PhpMyAdmin and Wordpress for LAMP applications

    PhpMyAdmin logon timeout Solution

    Install phpMyAdmin and Adminer in Ubuntu

    Implement SSL functions based on LAMP and install phpMyAdmin

    Configure the LAMP + phpMyAdmin PHP (5.5.9) development environment in Ubuntu 14.04

    PhpMyAdmin details: click here
    PhpMyAdmin: click here

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.