Loading...


bookmark - What If You Forget Mysql Root Password

What If You Forget Mysql Root Password

 
 Discussion by mukund with 2 Replies.
 Last Update: August 31, 2007, 5:49 am
 
bookmark - What If You Forget Mysql Root Password  
Quickly Post to What If You Forget Mysql Root Password  w/o signup Share Info about What If You Forget Mysql Root Password  using Facebook, Twitter etc. email your friend about What If You Forget Mysql Root Password Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

If you have set a root password, but forgot what it was, you can set a new password with the following procedure:
1. Take down the mysqld server by sending a kill (not kill-9) to the mysqld server. The pid is stored in a `.pid' file, which is normally in the MySQL database directory:
shell> kill `cat /mysql-data-directory/hostname.pid`
You must be either the Unix root user or the same user mysqld runs as to do this.

2. Restart mysqld with the --skip-grant-tables option.

3. Set a new password with the mysqladmin password command:
shell> mysqladmin -u root password 'mynewpassword'

4. Now you can either stop mysqld and restart it normally, or just load the privilege tables with:
shell> mysqladmin -h hostname flush-privileges

5. After this, you should be able to connect using the new password.

Alternatively, you can set the new password using the mysql client:

1. Take down and restart mysqld with the --skip-grant-tables option as described above.

2. Connect to the mysqld server with:
shell> mysql -u root mysql

3. Issue the following commands in the mysql client:
mysql> UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root';
mysql> FLUSH PRIVILEGES;

4. After this, you should be able to connect using the new password.

5. You can now stop mysqld and restart it normally.

   Mon Mar 14, 2005    Reply         

Kool tutorial m8. Hey do you have much knowledge about MYSQL servers? I just installed MYSQL V5.01 in my system but I dont know exactly what to do.

Plz help.

   Mon Mar 14, 2005    Reply         

the default password for mySQL is empty. if you forget your root password. it would be enough if you just reinstall the mySQL and login using null password.

   Fri Aug 31, 2007    Reply         


Quickly Post to What If You Forget Mysql Root Password  w/o signup Share Info about What If You Forget Mysql Root Password  using Facebook, Twitter etc. email your friend about What If You Forget Mysql Root Password Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Similar Topics:

What Is Mysql 39 s Default Root Pa...

I installed SuSE Linux 9.1 Professional on an old computer recently. I installed MySQL server (version 4.0.18), Webmin (version 1.250) and Usermin (version 1.180). If I try to connect to the MySQL server with the username root and no password, I get an invalid login error from Webmin, Usermin and my ...more

   28-Dec-2005    Reply         

How Do I Find My Mysql Password r...

After all the recent problems, my account has been restored. I have setup my parked domain agin, and that works fine. However, I can no longer access my MySQL databases (I can from PHPMyAdmin, but that's all). I had to create a new user for my databases, and created the ...more

   26-Jun-2008    Reply         

Default settings for mysql

Default settings for mysqlWhat Is Mysql's Default Root Password?I m using ubuntu and I have downloaded mysql query browser what is  server host name, username, password and port number. I have tried host name as localhost, username as root and password as blank and port number 3306. B ...more

   02-Mar-2010    Reply         

I Need Themes For My Ipb IPB 2.0 and Webdeisgns   I Need Themes For My Ipb IPB 2.0 and Webdeisgns (3) (0) Help With Xoops Site1 hELP NEEDED...  Help With Xoops Site1 hELP NEEDED...