![]() Instructions for manually resetting the MySQL root password "root" is the name of the user allowed to administer, write to, update, and change information within your MySQL database. Although it is recommended you use another user aside from root, the instructions below are for changing the root password. By DEFAULT the root password for MySQL is BLANK! The following Illustrates this. Start a command prompt window by clicking on START -- then RUN and type "cmd"
Next you will see a Command Prompt window (also referred to as a DOS prompt)
By default WAMP, does not place MySQL in the default path, so you must change to MySQL directory manuall. Because WAMP was installed in c:\wamp, change directories to c:\wamp\mysql\bin
Now type the following to reset the mysql root password to 'password' mysql -u root -p If you have NEVER established a password, the password will be BLANK, so hit ENTER. If you HAVE established a password, Enter the password when prompted.
If you are successful you will see the following command prompt.
Now you must reset the password for "root" by typing the following, where password is the password you are establighing for the root user. At the mysql prompt type the following mysql> use mysql; update user set password=password('password') where User='root'; flush privileges; *note, be sure to match the case, and use all quotes and the semi colons between statements as the above is actually 3 commands!
If you are successfull you will be returned to the command prompt and it will show 0 records updated
If you are successful, then type EXIT and you will be returned back to the command prompt
Now you can test to verify your password took by typing the following: mysql -u root -ppassword -e"show databases" *note: BE SURE to type it exactly as listed above WITHOUT a space between -p and the password. Otherwise you will be prompted to type the password. Here are the results of the command mysql -u root -ppassword -e"show databases"
If you wish to add the mysql path to your windows environment variables CLICK HERE for instructions
You may also perform all of the above functions using phpmyadmin. Documentation on this feature is available on www.wampserver.com and www.apachefriends.com
|