How to install phpMyAdmin on your server and computer

How to install phpMyAdmin on your server and computer

04.01.2022
Autor: HostZealot Team
2 min.
701

phpMyAdmin is a web interface for easy management of the MySQL DBMS, running SQL commands and viewing the contents of server databases. It is an open-source software product, that is, an open-source application. The capabilities of this web interface are very wide:

  • creating and deleting databases;
  • creating, copying, deleting, changing names;
  • table maintenance;
  • key management;
  • advanced database search;
  • simultaneous management of several servers;
  • database graphical schemes creation;
  • loading text files and tables;
  • export, import, and viewing table dumps;
  • converting stored data to any other formats;
  • SQL query execution and much more.

And with all that, phpMyAdmin supports multi-user use, which makes this application incredibly versatile and convenient. In this article, we will tell you how to install phpMyAdmin on your computer and server.

Installing phpMyAdmin correctly on your computer

Preconfiguring your computer involves installing and configuring three key components:

  1. Apache server.
  2. PHP.
  3. MySQL database.

Also, make sure that your computer is connected to the server via a secure protocol SSH, otherwise, you risk the security of the server.

When all these steps are made, proceed directly to the installation of phpMyAdmin on your computer. Go to the official website, there you will see a large list of current versions - choose the appropriate and download. Then:

  • go to the folder htdocs - it can be found on the system drive in the directory "Apache";
  • move the folder from the archive, wait for the end of the copying and change the name of the folder to "phpmyadmin";
  • go to the folder "PHP", looking for the file "php.ini-production" and change its name to "php.ini", and then run through Notepad;
  • look for the lines "extension=php_mysqli.dll" and "extension=php_mbstring.dll" - they need to remove the semicolon;
  • then save your changes and close the notepad.

Now, when you type http://localhost into the address bar, it will take you to the login page of the phpMyAdmin web interface.

Correct installation of phpMyAdmin on the server

The sequence of steps for installing the application will be different, depending on the operating system used. The general requirements are identical - connect only via a secure tunnel, and you will also need to install and configure the main server software beforehand - PHP, MySQL, and the Apache or Nginx web server. Below we will provide guidance for the three most popular operating systems.

how to install phpmyadmin on your server and computer

Installing phpMyAdmin on Ubuntu

Before proceeding to the installation, you need to check whether the server extension PHP is installed, because without it you can not edit text strings in Unicode. At the command line write:

sudo apt install php-mbstring

Once the update is complete, you can proceed directly to install the web interface. To do this, enter the command:

sudo apt install phpmyadmin

You will see an installer window where you can choose between two web servers to automatically reconfigure - apache2 and lighttpd. Choose apache2 and confirm with the space bar.

The next step will require you to create a database for the software you are installing - just agree and go on. The installer will ask you to think of a password for the new profile - preferably a complex one. Try to use letters in different case, numbers, and symbols. The combination should be somewhere to write down on a piece of paper or put in the password manager.

To complete the installation of phpMyAdmin on the server you need to enable two important extensions with the commands:

sudo phpenmod mcrypt
sudo phpenmod mbstring

Enter them one by one and then the server must be restarted. Use a special request:

sudo systemctl restart apache2

Done, phpMyAdmin on Ubuntu is installed and ready to go.

Manual for OS Debian

Before installation, you will need to pre-deploy to the server complex LAMP, which includes 4 components:

  • Linux - in our case any of the current Debian distributions.
  • Apache - free web server with flexible configuration and built-in virtual host mechanism.
  • MariaDB/MySQL - database management systems (DBMS).
  • PHP is a scripting language used to develop web applications and website pages.

If these components are not already on the server, after installing Debian from the command line, type the following:

apt install nginx php-fpm mysql-server

The installation will take some time and then you can proceed with the configuration. We recommend installing an SSL/TLS certificate for security, so you can encrypt the traffic being transmitted.

It should be stressed that many popular programs and components are missing from the Debian repositories, so the phpMyAdmin item needs to be attached manually. To do this open sources.list with the editor. Scroll down to the bottom and add two lines at the very end of the contents:

deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free

Confirm saving the changes and go back. The next step is to update the MySQL database. Use the command:

apt-get update

Then:

apt-get install phpmyadmin

In the window that appears, confirm the selected web server, and then you will get to a window asking if you want to allow the use of "dbconfig-common". Using this option is required to configure the database and the user with administrator privileges within the application phpMyAdmin, so we confirm.

It remains a small thing - come up with a complex password, enter it and complete the installation. When all components are installed, you can get to work. Verification can be done by going to the virtual domain.

Manual for CentOS

As in the previous two cases, the first thing to do is to install the Apache web server and PHP. Then install the EPEL repository with this command:

yum install epel-release

This gives you access to the package containing the installer phpMyAdmin. Let's proceed with the installation:

yum install phpmyadmin

Next, you must immediately install the LAMP components:

yum install php-json php-mbstring php-mysqli

And at the very end just reboot the server with a command:

systemctl restart httpd

After the reboot, configure the virtual domain using a special configuration file in the directory vi /etc/httpd/conf.d/phpMyAdmin.conf. Its contents should be as follows:

<VirtualHost *:80>
	Define root_domain phpmyadmin.dmosk.local
	Define root_path /usr/share/phpMyAdmin
	ServerName ${root_domain}
	ServerAlias www.${root_domain}
	DocumentRoot ${root_path}
	<Directory /usr/share/phpMyAdmin>
     	AllowOverride All
    	Options Indexes ExecCGI FollowSymLinks
    	Require all granted
	</Directory>
</VirtualHost>

You can just copy and paste it into a file. Be sure to save your changes. Just in case, enter a command:

apachectl configtest

It is needed to check for errors. If everything is correct and no errors are detected by the server, restart it. This concludes the installation of phpMyAdmin on CentOS. Now you can go to the page with the virtual domain, and after entering your password and username will be able to log in.

That is the end of our material. Should you have any questions or have any configuration issues, please feel free to contact the HostZealot specialists using the phone numbers indicated on our website or by a LiveChat. Have a nice day!

Verwandte Artikel