Change the ‘root’ password for MySQL in XAMPP?

By default, when you install XAMPP in your windows machine, the ‘˜root’ password for the MySQL is set to empty. But this is not recommended, as the MySQL database without a password will be accessible to everyone. To avoid this, a proper/secure password must be set to the user ‘˜root‘˜. To do it in XAMPP, there are two ways.


Method 1: reset XAMPP MySQL root password through web interface:

After you started your XAMPP server, go to the browser and type the URL http://localhost/security. The security page will be shown where you can change the ‘˜root’ password for MySQL. This will update the phpMyAdmin config also.


Method 2: reset XAMPP MySQL root password through SQL update:

  1. Start the Apache Server and MySQL instances from the XAMPP control panel.
  2. After the server started, open any web browser and give http://localhost:3306/phpmyadmin/ (if you are running XAMPP on 3306 port). This will open the phpMyAdmin interface. Using this interface we can manager the MySQL server from the web browser.
  3. In the phpMyAdmin window, select SQL tab from the right panel. This will open the SQL tab where we can run the SQL queries.
  4. Now type the following query in the textarea and click Go

    UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; FLUSH PRIVILEGES;

  5. Now you will see a message saying that the query has been executed successfully.
  6. If you refresh the page, you will be getting a error message. This is because the phpMyAdmin configuration file is not aware of our newly set root passoword. To do this we have to modify the phpMyAdmin config file.
  7. Open the file [XAMPP Installation Path] / phpmyadmin / in your favorite text editor.
  8. Search for the string $cfg[‘Servers’][$i][‘password’] = ‘; and change it to like this, $cfg[‘Servers’][$i][‘password’] = ‘˜password’; Here the ‘˜password’ is what we set to the ‘˜root’ user using the SQL query.
  9. Now all set to go. Save the file and restart the XAMPP server.

5 Tanggapan

  1. Interesting blog! Is your theme custom made or did you download it from somewhere?

    A theme like yours with a few simple adjustements would really make my blog jump out.
    Please let me know where you got your design.
    Appreciate it

  2. I was curious if you ever thought of changing the structure
    of your blog? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with
    it better. Youve got an awful lot of text for only having one or
    2 pictures. Maybe you could space it out better?

  3. Everything is very open with a really clear explanation of the challenges.

    It was definitely informative. Your site is very useful.
    Thank you for sharing!

  4. […] Change the ‘ root ’ password for MySQL in XAMPP … – May 20, 2013 · By default, when you install XAMPP in your windows machine, the ‘˜root’ password for the MySQL is set to empty. But this is not recommended, as the …… […]

  5. Some truly prime posts on this internet site, saved to my bookmarks.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

%d blogger menyukai ini: