Install phpMyAdmin on CentOS 7

phpMyAdmin is one of the best web interface based database management tool for MySQL. Using phpMyAdmin users can interact with the MySQL database easily. It provides the most useful functions to interact with the MySQL databases. In this tutorial, you will learn how to install phpMyAdmin on CentOS 7.

Prerequisites

1. Before you start installing phpMyAdmin on CentOS 7. You must have the non-root user account on your server with sudo privileges.

2. Make it sure that LAMP stack is installed on the server. If you have not installed it please use the following link to install LAMP: How to install LAMP stack on CentOS 7

1. Install phpMyAdmin on CentOS 7

phpMyAdmin is not available in CentOS core repositories so you will need to add EPEL reposiory by running following command

sudo yum install epel-release

Now you can install phpMyAdmin by typing following command. It will also install all the dependencies required.

sudo yum install phpmyadmin

2. Configure phpMyAdmin

As you are going to access phpMyAdmin from the remote location you will need to configure some settings. The configuration file for apache created during installation. By default, all connections are denied except localhost so you will need to modify config file and add allowed IP Addresses.

To get your IP Address enter following command in terminal.

curl ipinfo.io/ip

Enter following command to edit configuration file.

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

Replace Require ip 127.0.0.1 with Require ip YOUR_IP_ADDRESS

Example is given in following code.

# Apache 2.4
<RequireAny>
    Require ip 192.168.43.103 Require ip ::1 </RequireAny>

Now restart Apache By entering following command.

sudo systemctl restart httpd

Now you can login to phpMyAdmin by going to following link https://YOUR_DOMAIN_NAME/phpmyadmin or on your desktop http://127.0.0.1/phpmyadmin/.

NOTE : Remember you should know username and password for database. if you don’t know follow next step and create a user with permissions.

Install phpMyAdmin on CentOS - Login to phpMyAdmin
Install phpMyAdmin on CentOS – Login to phpMyAdmin

3. Create Database User (Optional)

Open MySQL shell by typing following command

sudo mysql

Create a new user by typing following command

CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';

Grant all permissions to the created user by typing

GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost' WITH GRANT OPTION;

Exit MySQL shell by typing

exit;

Now you can login to phpMyAdmin by going to following link https://YOUR_DOMAIN_NAME/phpmyadmin or on your desktop http://127.0.0.1/phpmyadmin/.

Conclusion

You have successfully installed phpMyAdmin on CentOS 7. If you have any queries regarding this please don’t forget to comment below.

Install phpMyAdmin on Debian

phpMyAdmin is a database management tool for MySQL which comes with web interface. By using phpMyAdmin users can interact with MySQL easily. I also provides most useful functions to interact with the MySQL databases. This tutorial outlines how to install phpMyAdmin on Debian 9.

Prerequisites

1. Before you start installing phpMyAdmin on Debian 9. You must have the non-root user account on your server/desktop with sudo privileges.

2. Make it sure that LAMP stack is installed on the server. If you have not installed it please use the following link to install How to install LAMP stack on Debian 9.

Install phpMyAdmin on Ubuntu

First, you will need to update apt package manager index then you will install and configure phpMyAdmin on Ubuntu.

Update apt package manager index by running following command.

sudo apt update

Now install phpMyAdmin by typing following command in terminal, it will also install required dependencies for phpMyAdmin.

sudo apt install phpmyadmin php-mbstring php-gettext

You will be asked for basic configuration for phpMyAdmin. First, you will need to select apache as web server. Select Apache and click OK.

Install phpMyAdmin on Debian - select web server
Install phpMyAdmin on Debian – select web server

Now it will ask you to configure the database for phpMyAdmin. Select YES and press Enter to continue.

Install phpMyAdmin on Debian - configuare database for phpmyadmin
Install phpMyAdmin on Debian – configure database for phpmyadmin

Now you will be prompted for setting the password. Enter the password and click OK to continue.

Install phpMyAdmin on Debian - Enter password for phpMyAdmin
Install phpMyAdmin on Debian – Enter password for phpMyAdmin

Now enter the following command to enable php-mbstring extension

sudo phpenmod php-mbstring

Restart apache2 by typing following command

sudo systemctl restart apache2

Configure phpMyAdmin

Apache configuration file will be created at /etc/phpmyadmin/apache.conf. You can edit configuration file.

Now check if soft link is created at /etc/apache2/conf-enabled/phpmyadmin.conf. If not created by default then please create by typing following.

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf

Now enter following

sudo a2enconf phpmyadmin

After executing above entries please type following in terminal to restart Apache service

sudo systemctl restart apache2

Now you can login to phpMyAdmin by going to following link https://YOUR_DOMAIN_NAME/phpmyadmin or on your desktop http://127.0.0.1/phpmyadmin/

URL not found error (Optional)

If you dont get any error then please drop this step and If you get http://127.0.0.1/phpmyadmin/ this URL not found error then do following things

Enter following command to edit Apache configuration file.

sudo -H gedit /etc/apache2/apache2.conf

Now add the following line to the end of the file.

Include /etc/phpmyadmin/apache.conf

Then restart apache server by typing.

sudo systemctl restart apache2

Now you can login to phpMyAdmin by going to following link https://YOUR_DOMAIN_NAME/phpmyadmin or on your desktop http://127.0.0.1/phpmyadmin/

Create Database User

Open MySQL shell by typing following command

sudo mysql

Create a new user by typing following command

CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';

Grant all permissions to the created user by typing

GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost' WITH GRANT OPTION;

Exit MySQL shell by typing

exit;

Now you can login with created users credentials and access phpMyAdmin

Install phpMyAdmin on Debian - Login to phpMyAdmin
Install phpMyAdmin on Debian – Login to phpMyAdmin

Conclusion

In this tutorial you have learned how to install phpMyAdmin on Debian 9. If You have any queries regarding this please comment below.

Install phpMyAdmin on Ubuntu

phpMyAdmin is a web interface based database management tool for MySQL. Using phpMyAdmin users can interact with MySQL easily. phpMyAdmin provides most useful functions to interact with the MySQL database. In this tutorial you will learn how to install phpMyAdmin on Ubuntu.

Prerequisites

1. Before you start installing phpMyAdmin on Ubuntu 18.04. You must have the non-root user account on your server/desktop with sudo privileges.

2. Make it sure that LAMP stack is installed on the server. If you have not installed it please use the following link to install LAMP: How to install LAMP stack on Ubuntu 18.04

1. Install phpMyAdmin on Ubuntu

To start installing you need to update Ubuntu package index by using the following command

sudo apt update

Here you will install phpMyAdmin from default Ubuntu repositories. Now to install phpMyAdmin and required extensions please use the following command

sudo apt install phpmyadmin php-mbstring php-gettext

On executing above command it will ask you some questions about configuration

1. To select apache server, please press ==SPACE,TAB== and then ==ENTER==

2. When it will ask you to use ==dbconfig-common== to select database enter ==YES==.

3. Then enter the password for MySQL and complete the installation

Now you need to enable php-mbstring extension.

sudo phpenmod mbstring

Restart apache to reload all the changes done.

sudo systemctl restart apache2

2. Configure phpMyAdmin

Apache configuration file will be created at /etc/phpmyadmin/apache.conf. You can edit configuration by using your favourite text editor.

Check if soft link is created at /etc/apache2/conf-available/phpmyadmin.conf. If not created by default then please create by typing following.

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

Now enter following

sudo a2enconf phpmyadmin

After executing above entries please type following in terminal to restart Apache service

sudo a2enconf phpmyadmin

Login to phpMyAdmin, Now you can login to phpMyAdmin by going to following link https:// YOUR DOMAIN NAME /phpmyadmin.

3. URL not found error (Optional)

When you get http://127.0.0.1/phpmyadmin/ this URL not found error then do following things otherwise you can skip this step.

Enter following command to edit Apache configuration file.

sudo -H gedit /etc/apache2/apache2.conf

Now add the following line to the end of the file.

Include /etc/phpmyadmin/apache.conf

Then restart apache server by typing.

sudo systemctl restart apache2

Login to phpMyAdmin by going to following link https://YOUR_DOMAIN_NAME/phpmyadmin or on your desktop http://127.0.0.1/phpmyadmin/

4. Create Database User

Open MySQL shell by typing following command.

sudo mysql

Create a new user by typing following command in the terminal.

CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';

Grant all permissions to the created user by running following query.

GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost' WITH GRANT OPTION;

Exit MySQL shell by typing

exit;

Now you can login with created users credentials and access phpMyAdmin

Install phpMyAdmin on Debian - Login to phpMyAdmin

Conclusion

In this tutorial you have learned how to install phpMyAdmin on Ubuntu 18.04. If You have any queries regarding this please comment below.