I trust that you found this blog post to be enjoyable. If you are interested in having my team handle your eCommerce setup and marketing for you, Contact Us Click here.

Installation of phpMyAdmin in Ubuntu

Installation of phpMyAdmin in Ubuntu

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:

  1. 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.
  2. LAMP: The LAMP(Linux, Apache, MySQL, and php). If this is not installed yet, Install them first.

3.Process to install phpMyAdmin

  1. Update the Package
    $ sudo apt update
  2. Some packages need to be installed
      1. Php-mbstring: A module that handles the non-ASCII and enables the
      2. Php-zip: This extension allows uploading a .zip file to phpMyAdmin.
      3. Php-gd: Enable support for the gd library used for image processing.
      4. 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-curl

    we 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 mysql

    Or, if you enabled password authentication for the root MySQL user, run this command and then enter your password when prompted:

    $ mysql -u root -p

    When 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> exit

    Type “exit” to terminate the MYSQL prompt.

  3. 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";
  4. 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

      1. 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
      1. 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 mysql
    mysql> 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> exit

    Now 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.

Back to blog