Change MySQL Password Using WAMP Server

Yesterday I found the need to change the password for MySQL (using WAMP SERVER) and realised that other people might need to do the same. So, follow these steps to change your password for MySQL when using WAMP Server.

  • Left click once on the WAMP Server icon in the System Tray, mouseover MySQL then left click on the MySQL Console
    Left click once on the WAMP Server icon
  • When the console window opens, press Enter once (because you have no password set)
    Press Enter Once
  • Now type SET PASSWORD FOR root@localhost=PASSWORD('AnyPasswordYouLike'); then press Enter (Replace “AnyPasswordYouLike” with a password of your choice)
    Set Password of your choosing
  • You can now exit the MySQL Console

Now we need to update the config file for PHPMyAdmin to prevent you from getting the following error:
PHPMyAdmin Error

To do this, follow these steps:

  • Navigate to your PHPMyAdmin folder (mine was located in C:\wamp\apps\phpmyadmin4.1.14)
    Browse to PHPMyAdmin Folder
  • Edit “config.inc.php” in a text editor like Dreamweaver, Notepad or Notepad++
  • Edit line 33 (in my config file) to include the password that you set in the MySQL Console
    Enter Your Password
  • Save the file and you should now have access to PHPMyAdmin using your new password

PHPMyAdmin is now accessible

It may be necessary to change the password that you set. Doing this is quite easy.

  • Open the MySQL Console
    Open MySQL Console
  • Enter your password then press Enter
    Enter Your Password
  • Type UPDATE mysql.user
    SET Password = PASSWORD('newPassword')
    WHERE User='root';

    Then press Enter
    Update Root Password
  • Type Flush Privileges;
    Flush Privileges
  • Close MySQL Console

Great job guys/gals. Now remember to use your password when accessing your MySQL databases.

Tags: , ,