Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> What If You Forget Mysql Root Password
mukund
post Mar 14 2005, 08:31 AM
Post #1


Member [Level 2]
*****

Group: Members
Posts: 78
Joined: 14-March 05
Member No.: 4,492



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.
Go to the top of the page
 
+Quote Post
odomike
post Mar 14 2005, 07:47 PM
Post #2


Core2Q-QX6800
***********

Group: [HOSTED]
Posts: 1,093
Joined: 3-August 04
From: Nigeria
Member No.: 569



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.
Go to the top of the page
 
+Quote Post
kuberan_swe
post Aug 31 2007, 12:49 PM
Post #3


Member [Level 2]
*****

Group: Members
Posts: 78
Joined: 10-August 07
Member No.: 47,922



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Php Tutorial - Basics...up To Mysql/file Commands(1)
  2. Mysql Infos(2)
  3. Mysql Tool(0)
  4. Mysql And Ms Access(1)
  5. Mysql Host Adress(4)
  6. Import From Excel File Into Mysql Database(7)
  7. Php And Mysql Problem(8)
  8. Tips On Creating Your Own Search(1)
  9. Accessing Password-protected Urls(4)
  10. Syndicate Your Content Using Php And Mysql(0)
  11. Phpbb And Mysql Relations?(2)
  12. How Do You Combine Multiple Mysql Databases Into One Database?(3)
  13. Merging Database Php Mysql(5)
  14. Which Data Type To Use In Mysql Table(4)
  15. Another Question On Mysql Table Data Type(1)
  1. Accessing Mysql From Javascript(4)
  2. Mysql + Php Question(5)
  3. Index In A Mysql Database(3)
  4. Mysql(2)


 



- Lo-Fi Version Time is now: 26th July 2008 - 06:11 PM