MySQL Change Root Password In XAMPP

note:  as of MariaDB 10.4, this post is no longer effective.


Good post about how to change root password for MYSQL in XAMPP:

Here’s  briefly how to do it:

  • Start Apache and Mysql
  • Goto localhost/phpmyadmin
  • Type in following SQL command: UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’root’; FLUSH PRIVILEGES;
  • Open the file [XAMPP Installation Path] / phpmyadmin / in your favorite text editor.
  • 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.
  • You are done.  Restart the servers.