Forget root password in Windows
If you have forgotten the root password locally, try the following methods:
Open cmd first stop MySQL service
The code is as follows |
Copy Code |
net stop MySQL |
Enter the Bin folder in the MySQL installation directory and enter
The code is as follows |
Copy Code |
Mysqld-nt--skip-grant-tables |
Skip Password detection
Then another new CMD window opens
Enter MySQL direct return can enter MySQL with root privileges
The code is as follows |
Copy Code |
Use MySQL Update user set Password=password ("New password") where user= "root"; Flush privileges; |
If no error is prompted, the password can be changed successfully.
Forget root password in Linux
Linux Root has the supremacy of power, once the root password forgotten or stolen, is a very headache, then how to retrieve the root password, I summed it up as follows:
(i) Linux system password cracking
1. Enter edit mode by E in the Grub options menu
2. (press e) Edit kernel line add/init 1 (or/single)
3. Restart by B
4. After entering, execute the following command
The code is as follows |
Copy Code |
#vi/etc/passwd into passwd file |
The first line of the root:x:0 .... In the x Delete, become root::0 .... Then save the exit!
In the system at this time the root password is empty.
Modify password
code is as follows |
copy code |
#passwd Root |