How To Configure Root Password for phpMyAdmin MySQL in XAMPP

Hello Everyone, So here I am going to tell you how to configure or change the root password for phpMyAdmin MySQL user account in XAMPP. By default, the MySQL/MariaDB installation that comes with XAMPP has an empty root password. This is a serious security risk, especially if you plan to use XAMPP for organizational work.
XAMPP is the most popular PHP development environment and also used to setup local server to work offline. You can use XAMPP to install WordPress locally

Change MySQL Password in XAMPP

To change the MySQL/MariaDB root password, follow these steps:
  1. Ensure that the MySQL/MariaDB server is running.
  2. Open your command prompt by clicking the “Shell” button in the XAMPP control panel.

Change Xampp Mysql Password Shell

3. Use the mysqladmin command-line utility to alter the MySQL/MariaDB password, using the following syntax:
mysqladmin --user=root password "newpassword"
For example, to change the root password from its default empty value to the password 1234, you would type and execute:
mysqladmin --user=root password "1234"

change xampp phpmyadmin mysql password
Or, if a password has already been previously set and you’d like to change it to a new one, you can use the following syntax:
mysqladmin --user=root --password=oldpassword password "newpassword"
For example, to change the root password from 1234 to gue55me, you would execute:
mysqladmin --user=root --password=12345 password "gue55me"

4. After making changes in password through Shell you have to change password in config.inc.php file to avoid database connection error. Your database will not work if you do not make changes in config.inc.php
Go to C:\xampp\phpMyAdmin and find config.inc.php file and open this file with any text editor and make chhanges as shown in image-
xampp config.inc.php
Test that your password change has been accepted, by attempting to connect to the MySQL/MariaDB server using the command-line client in the same directory. For example, you could use the command below to connect to the server and return the results of a calculation:
mysql --user=root --password=gue55me -e "SELECT 1+1"

federal bank support neteller
Note: After every changes you made in password through XAMPP Shell, you also have to make changes in config.inc.php file
Previous Post
Next Post

post written by:

0 comments: