1.Introduction
phpMyAdmin has become a popular, free, open-source software platform for the administration of MySQL and MariaDB data over the web world. This tool is primarily written in PHP for web hosting and related services. It supports a wide range of operations on MySQL and MariaDB. Mainly used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface. A user can still directly execute the SQL query or statements. phpMyAdmin is a GUI-based application that is used to manage MySQL databases. We can manually create a database and table and execute the query on them. It provides a web-based interface and can run on any server.
2.Prerequisites
In Order to install the phpMyAdmin, We need to make sure of the following requirements:
- User: A non-root user with administrative privileges who can perform the tasks related to administration, which has unrestricted access to all system commands can perform installation of software or modification of the system settings.
- LAMP: The LAMP(Linux, Apache, MySQL, and php). If this is not installed yet, Install them first.
3.Process to install phpMyAdmin
- Update the Package
$ sudo apt update
- Some packages need to be installed
- Php-mbstring: A module that handles the non-ASCII and enables the
- Php-zip: This extension allows uploading a .zip file to phpMyAdmin.
- Php-gd: Enable support for the gd library used for image processing.
- Php-curl:This allows PHP to interact with the various kinds of servers using multiple protocols, thus enhancing the ability to send and receive the data.
$ sudo apt install phpmyadmin php-mbstring php-zip php-gd php- json php-curlwe may have decided to enable the Validate Password plugin. If we do so, if we enable this component, it will trigger an error when you attempt to set a password for the phpmyadmin user:
To resolve this issue, choose the abort option and it will stop the installation process. Then you have to open up your MySQL prompt:
$ sudo mysqlOr, if you enabled password authentication for the root MySQL user, run this command and then enter your password when prompted:
$ mysql -u root -pWhen the prompt appears, we have to run the following command to disable the Validate Password component.
Note: it won’t actually uninstall it, but we need to stop the component from being loaded on the MySQL server:
mysql> UNINSTALL COMPONENT "file: //component validate password"mysql> exitType “exit” to terminate the MYSQL prompt.
- Install the phpMyAdmin
$ sudo apt install phpmyadmin
Once phpMyAdmin is installed, you can open the MySQL prompt once again with sudo mysql or MySQL -u root -p and then run the following command to re-enable the Validate Password component:
mysql> INSTALL COMPONENT "file://component_validate_password"; - Authentication and Privileges
When you have successfully set up the phpmyadmin, it creates the phpmyadmin user automatically for handling all the internal processes. Instead of logging in with the phpmyadmin user, it is recommended to use either the root MYSQL user or a separate user for managing database phpMyAdmin.
Configuring Password Access for the MySQL Root Account
- The root user is logged into the phpmyadmin on Ubuntu, we need to change the way MYSQL handles the authentication or login method. MYSQL uses the auth_socket, which authenticates the username instead of the password. To do so, Open the terminal, Then open the mysql prompt:
$ sudo mysql- You can check the authentication method from each of your accounts.
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
The above table shows how different MYSQL users set up login for example root, phpmyadmin, etc. The most important part is the plugin that shows how the user authenticates.
Configuring Password Access for a Dedicated MySQL User
We can perform the authentication with the dedicated user Open the terminal do the following process :
$ sudo mysqlmysql> CREATE USER 'sammy'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password'Note : Creating the user for authentication
mysql> ALTER USER ' sammy '@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'Note: Here you have to set the authentication with mysql_native_password instead of caching_sha2_password
Note: Grant all the permission to the user to create, add, update, and delete the following the commands:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;mysql> exitNow access the phpMyAdmin in the browser with the :
https://localhost/phpmyadmin.
Visit the official website https://www.ptiwebtech.com/ to check out the best Development Company in India.