How To Recover Phpmyadmin Password

Introduction

phpMyAdmin is a popular open-source tool for managing MySQL and MariaDB databases. It provides a web-based user interface for easy management of your databases. However, there might be situations where you lose or forget the password for your phpMyAdmin. This blog post will guide you through the process of recovering your phpMyAdmin password.

Step 1: Locate the Configuration File

The first step in recovering your phpMyAdmin password is finding the configuration file. The configuration file is usually named config.inc.php and is located in the phpMyAdmin installation directory. The location may vary depending on your operating system and installation method.

  • For Linux systems, it is usually located in /etc/phpmyadmin/ or /usr/share/phpmyadmin/.
  • For Windows systems using XAMPP, it is usually located in C:\xampp\phpMyAdmin\.
  • For Windows systems using WampServer, it is usually located in C:\wamp\apps\phpmyadmin{version}\.

Step 2: Edit the Configuration File

Once you have located the config.inc.php file, open it with a text editor such as Notepad++ or Visual Studio Code. In this file, you will find the following line:

$cfg['Servers'][$i]['password'] = 'your_password';

Replace your_password with a new password of your choice. Make sure to keep the single quotes around the new password. Save the changes and close the text editor.

Step 3: Restart the Web Server

In order for the changes to take effect, you will need to restart your web server. The process for restarting the web server depends on your operating system and installation method.

  • For Linux systems using Apache, run the following command in the terminal: sudo service apache2 restart.
  • For Windows systems using XAMPP, open the XAMPP Control Panel, stop the Apache service, and then start it again.
  • For Windows systems using WampServer, click on the WampServer icon in the system tray, and then click on “Restart All Services”.

Step 4: Verify the New Password

Now that you have changed the password and restarted the web server, verify that the new password works by logging into phpMyAdmin. Open your browser and navigate to your phpMyAdmin URL, which is usually http://localhost/phpmyadmin or http://your_server_ip/phpmyadmin. Enter your username (usually root) and the new password you set in the configuration file. You should be able to log in successfully.

Conclusion

Congratulations! You have successfully recovered your phpMyAdmin password. Always remember to keep your passwords secure and stored in a safe place. If you have any questions or need further assistance, feel free to leave a comment below.