Here’s a step-by-step guide on how to install XAMPP
and change the MySQL root password:
🔧 Part 1: Install XAMPP
✅ For Windows:
- Download
XAMPP
Go to the official site:
👉 https://www.apachefriends.org - Run
the Installer
Double-click the .exe file you downloaded. - Choose
Components
Leave default selections (Apache, MySQL, PHP, phpMyAdmin) and click Next. - Select
Install Location
Default is C:\xampp – Click Next. - Complete
Installation
After installation, check Start Control Panel and click Finish. - Start
Apache and MySQL
Open XAMPP Control Panel and click Start next to Apache and MySQL.
🔐 Part 2: Change MySQL
Root Password
Default username: root
Default password: (blank)
🟠 Method 1: via
phpMyAdmin
- Go to:
http://localhost/phpmyadmin
- Click
on User accounts tab.
- Find
the user root@localhost, and click Edit privileges.
- Scroll
down to Change password section.
- Enter
your new password twice, then click Go.
After this, phpMyAdmin may give an error. You’ll need to
update its config.
Fix phpMyAdmin login after changing password:
- Open
this file:
C:\xampp\phpMyAdmin\config.inc.php - Find
this line:
#php
$cfg['Servers'][$i]['password'] = '';
- Replace
with:
#php
$cfg['Servers'][$i]['password'] = 'your_new_password';
- Save
and restart Apache + MySQL in XAMPP Control Panel.
🟠 Method 2: via MySQL
Command Line (Optional)
- Open
XAMPP Control Panel → Click Shell.
- Enter
MySQL:
#nginx
mysql -u root
- Set a
new password:
#sql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';
FLUSH PRIVILEGES;
EXIT;
how to install xampp,
install xampp on windows,
xampp installation guide,
xampp setup tutorial,
xampp install php and mysql
0 Comments