Change MySQL root password in WampServer



We have seen following topics earlier regarding installation of wampserver.

  1. Install WampServer
  2. Test WampServer
  3. Start WampServer when it goes offline

In this tutorial we are now going to see how to open the phpMyAdmin from the WampServer icon from the system tray and changing the root password.

Steps to change root password :

WampServer Menu

  1. Open the MySQL console by selecting the menu shown above.
  2. After clicking on the “MySQL console” following console window will be opened where default password is empty so we hit one enter key to continue without typing –
  3. mysql menu wampserver

  4. Now in order to change the default password we need to type following query in the MySQL console (we are setting password as – “roor“)
  5. SET PASSWORD FOR root@localhost=PASSWORD('root');
  6. In the older versions of the phpmyadmin we need to manually change the password in the phpmyadmin config file but in the current version we can skip this step.

Updating the password of root or any user :

We can use following query in the mysql console for updating the query –

mysql> UPDATE mysql.user 
       SET Password = PASSWORD('pwd') 
       WHERE User='root';

In the above example we are setting password “pwd” to the user “root”.