Home > English > Tutorials > How to install PHPMyAdmin on CentOS 7 (for LAMP)

How to install PHPMyAdmin on CentOS 7 (for LAMP)

 

Features of phpMyAdmin :

Friendly web interface

Support almost all MySQL functionalities

Browse and drop the database, tables, viewpoints, fields and indexes

Creat, copy, drop, rename and change the database, tables, viewpoints, fields and indexes

Manage MySQL users and monopolies

Import data from CSV and SQL

Export data in various formats such as CSV , SQL , XML , PDF , ISO / IEC 26300 - OpenDocument Text and speadsheet, Word , LATEX and others

Manage multiple servers

I.Preparation

Install Remi repositories. Get the reference link here click here

Make sure LAMP has been installed in centos 7 server . Get the reference link here click here

II.Proceeding 

Step 1: Install phpMyAdmin

# yum install phpmyadmin -y

Step 2: config phpMyAdmin

When the installation is completed, you need to configure PHPMyAdmin to make it allow remote access

Open files and make changes as follows to allow your IP access

# nano /etc/httpd/conf.d/phpMyAdmin.conf

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     Require local
(change into Require ip <your IP>)
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from
127.0.0.1(change into Allow from <your IP>)
     Allow from ::1
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     Require local
 (change into  Require ip <your IP>)
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from
127.0.0.1( change into Allow from <your IP>)
     Allow from ::1
   </IfModule>
</Directory>

When you complete, reboot the server of the web Apache :

# systemctl restart httpd.service

 

Step 3 : Visit phpMyAdmin on your browser 

Now you can visit phpMyAdmin on your browser using vps IP

Login : user name and password to use MariaDB .

http://ip-vps/phpMyAdmin/

Note: because the link /phpMyAdmin is defaulted and widely-known, you can change the link to increase security of phpMyAdmin

Eg :change http://ip-vps/phpMyAdmin/ into http://ip-vps/datadb/

Open the configuration file of phpMyadmin 

# nano /etc/httpd/conf.d/phpMyAdmin.conf

and edit as follows

#Alias /phpMyAdmin /usr/share/phpMyAdmin ( add the sign '#' to end the link flow )
#Alias /phpmyadmin /usr/share/phpMyAdmin ( add the sign '#' to end the link flow)

Alias /dulieudb /usr/share/phpMyAdmin (add this line to creat a new link )

Remember to restart apache

# systemctl restart httpd.service

And see the result