How to reset SQL root password

Lost your MySQL root password? Resetting MySQL root password is simple. Please follow these steps-

# Login to your MySQL server.
# Locate the mysql.ini file.
-This should be something like C:\MySQL\my.ini or “C:\Program files\MySQL\bin\mysqld-nt.exe” –defaults-file=”C:\Program files\MySQL\Data\my.ini” MySQL
-You can also check this by viewing the Properties of the MySQL service command line under the Services MMC.
# Edit the appropriate *.ini file and add the following line immediately after [mysqld] ;
skip_grant_tables = 1
# Restart the MySQL service. Please note that MySQL is now running unsecured.
# From a command prompt, change to the /bin directory (Ususally C:\MySQL\bin or whereever under MySQL installed location) and enter the following command to login as root:
mysql -u root
# Then input the following command:
update mysql.user SET Password = Password(’newpassword’) WHERE User=’root’;
# Now remove the line you added to my.ini in previous step and restart MySQL.
# Make sure you can login to MySQL using the updated password.

Replies

  • safwan
    safwan
    I think this should come in CS section.

You are reading an archived discussion.

Related Posts

IF u think u cannot format c drive when windows is running so try this & u can test on other drives this is simple binary code format c:\ /Q/X...
How to make our own shortcut key Follow these steps 1)Select file or folder of which u want to make a shortcut key 2)Right click on it & Select Send...
To this what can be done is that the USB can be blocked and then stopping the use of USB drives. Here is a simple registry hack to do so,...
There are many new features in Windows Vista that are installed by default that you may not need. These extra and un-needed features can slow down your computer and take...
what is the difference between horizontal suspension and any other type of vertical suspension? why horizontal suspension is preferred in formula car over other suspension?