Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Security»How to Disable root Login in phpMyAdmin

    How to Disable root Login in phpMyAdmin

    By RahulAugust 7, 20212 Mins Read

    phpMyAdmin is the most popular web application for managing MySQL database servers. Many users also used it to access databases of production environments. In that case, security is a major concern. Providing root account access of phpMyAdmin can be harmful to your database server. So we recommend using non-root accounts for acceding databases.

    Advertisement

    This tutorial will help you to completely disable root login in phpMyAdmin.

    Disable root Login in phpMyAdmin

    First of all, find the phpMyAdmin directory location as per your installation. Generally, it is installed under /usr/share/phpmyadmin directory. In some cases, the configuration file may be located under the /etc/phpmyadmin directory.

    Switch to the phpMyAdmin directory:

    cd /usr/share/phpmyadmin 
    

    Then edit config.in.php, which is the main configuration file for phpMyAdmin.

    vim config.inc.php 
    

    and add/update following parameters:

    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['AllowRoot'] = FALSE;
    

    Some of the default installations may not have the config.inc.php. In that case, you can make a copy of the config.sample.inc.php file at the same location.

    cp config.sample.inc.php config.inc.php 
    

    Test Configuration

    Open phpMyAdmin in a web browser and try login with the root account. You will see “Access denied!” error message on screen. It means the changes work correctly.

    disable root phpmyadmin

    References:
    How to Install phpMyAdmin on CentOS using Yum
    Setup phpMyAdmin on CentOS, RHEL and Fedora Using Source Files

    Adminer MySQL PHP phpmyadmin PMA security
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Installing PHP on Pop!_OS

    How to Install PHP 8.x on Pop!_OS

    Managing Dependencies with Composer: A Beginner’s Guide

    (Resolved) MySQL connection error: certificate verify failed

    View 1 Comment

    1 Comment

    1. eb on May 30, 2020 9:58 am

      Thanks! But how without ‘root’ then do I access the phpmyadmin? 🙂

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.