Welcome to totatca.com!
In the article, How to Disable root Login in phpMyAdmin. We will guide you on enhancing the security of phpMyAdmin by disabling the root login.
In your MySQL/MariaDB database management, the root account holds the highest level of access and poses risks if not properly managed. By disabling the root login in phpMyAdmin, you can limit the access capabilities of the root user and create a separate user account for administrative tasks.
Throughout this article, we will provide you with a detailed guide on how to disable the root login in phpMyAdmin on the Ubuntu operating system. We will walk you through specific steps and provide clear explanations, allowing you to easily follow along.
By implementing this security measure, you will enhance the safety of your database and minimize the risks of unwanted intrusion attempts. Let’s get started and learn how to effectively disable the root login in phpMyAdmin to safeguard your data.
Prerequisites
- phpMyAdmin has already been installed
- User privileges: root or non-root user with privileges.
Read more
- How to Install and Configure phpMyAdmin on Ubuntu with Apache
- How to Use CHMOD Command in Linux
- How to Create New Admin User in phpMyAdmin
- How to Install and Configure Nagios Core Server on Ubuntu/Debian/Linux Mint
- How to Add Google Drive to File Explorer | Map Google Drive to PC
In the previous article, How to Install and Configure phpMyAdmin on Ubuntu with Apache we installed phpMyAdmin in the directory /usr/share/phpmyadmin
. Now, let’s navigate to that directory using the following command:
cd /usr/share/phpmyadmin
ls
Copy the default configuration file config.sample.inc.php to config.inc.php using the following command:
sudo cp config.sample.inc.php config.inc.php
ls
Next, open the configuration file config.inc.php using your preferred text editor:
sudo vim config.inc.php
In section /* Authentication type */, add the line $cfg['Servers'][$i]['AllowRoot'] = FALSE;
below the line $cfg['Servers'][$i]['auth_type'] = 'cookie';
as shown below:
/* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['AllowRoot'] = FALSE; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false;
After finishing, save and exit the file
Now, restart the Apache service to apply the changes:
sudo systemctl restart apache2
Finally, to test open phpMyAdmin in a web browser and try login with the root account. You will see Access denied! error message on the page. It means the changes work correctly.
Conclusion
Disabling root login in phpMyAdmin is a crucial security measure to protect your valuable data from potential threats. By creating separate user accounts for administrative tasks, you ensure that only authorized individuals can manage your database.
Through this article, you have gained the knowledge and skills needed to secure phpMyAdmin and your database. If you have any questions or require further assistance, please don’t hesitate to reach out to us. We are always here to help.
Thank you for reading !!!