This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14051|Reply: 0

[Source] MySQL Forgot Password Recovery Password Implementation Method

[Copy link]
Posted on 2/6/2015 4:11:04 PM | | |

Mysql5.1 admin password crack ends here.
1. Send a kill command to mysqld server to turn off mysqld server (not kill -9), and the file that stores the process ID is usually in the directory where the MYSQL database is located.  
killall -TERM mysqld  
You must be the root user of UNIX or the equivalent on the SERVER you are running to do this.  
2. Use the '--skip-grant-tables' parameter to start mysqld. (/usr/bin/safe_mysqld --skip-grant-tables under LINUX, c:\mysql\bin\mysqld --skip-grant-tables under windows)  

3. Then log in to MySQLD Server without a password,  
>use mysql  
>update user set password=password("new_pass") where user="root";  
>flush privileges;  
。 You can also do this: 'mysqladmin -h hostname -u user password 'new password''.  

4. Load permission table: 'mysqladmin -h hostname flush-privileges' or use the SQL command 'FLUSH PRIVILEGES'.  
5.killall -TERM mysqld  
6. Log in with the new password  

Correction: Here's what I actually do under Windows  
1. Close the running MySQL.  
2. Open a DOS window and go to the mysql\bin directory.  
3. Type mysqld-nt --skip-grant-tables into enter. If there is no prompt message, then yes.  
4. Open another DOS window (because the DOS window just now can no longer be moved) and go to the mysql\bin directory.  
5. Enter MySQL enter, if successful, the MySQL prompt > will appear  
6. Connect to the permission database >use mysql; (> is the original prompt, don't forget the last semicolon)  
6. Change password: > update user set password=password("123456") where user="root"; (Don't forget the last semicolon)  
7. Refresh permissions (required step) >flush privileges;  
8. Exit > \q  
9. Log out of the system, then enter, open MySQL, and log in 123456 using the username root and the new password you just set.  

It is said that you can directly modify the user table file:  
Close MySQL, open Mysql\data\mysql on Windows, there are three files user.frm, user. MYD,user. MYI finds a MySQL that knows the password, replaces the corresponding three files, if the user table structure has not been changed, generally no one will change it, replace the user. MYD will do.  
You can also edit the user. MYD, find a hexadecimal editor, UltraEdit has this function. Close MySQL and open user. MYD。 Change the eight characters after the root of the username to 565491d704013245, and the new password is 123456. Or change their corresponding hexadecimal numbers, (on the left, one character corresponds to two numbers), to 00 02 02 02 02 02 02, which is an empty password, and you will see an asterisk * on the right side of the editor, which looks like a decimal point. Reopen MySQL and enter the root and your new password.
I have something to do to enter mssql today, because it was installed a long time ago, so I forgot the password of SA, although you can enter with Windows authentication, but if you use php to connect to mssql, it won't work, so I googled it and found a solution.

Go in with Windows authentication, then
Enter the following command and execute:
exec sp_password null,'newpass','sa'

example
A.Change your login password if you don't have the original password
The example below changes the password to log in to Victoria to 123
EXEC sp_password NULL,'123','sa'

B. Change your password
The following example changes the password for logging in to Victoria from 123 to 456
EXEC sp_password '123','456'

Another problem I found is that the authentication mechanism for Windows and SQL Server is a bit different
Windows authentication

Server Address Login Result
127.0.0.1 ok
localhost wrong
. ok

SQL Server authentication

Server Address Login Result
127.0.0.1 ok
localhost wrong
. wrong


Also, record how to retrieve the forgotten mysql password
If MySQL is running,
Kill it first: killall -TERM mysqld (if it is windows, directly call the process manager and end it)
To start MySQ in Safe Mode:
/usr/bin/safe_mysqld --skip-grant-tables &
(Windows MySQL installation disk /mysql/bin/safe_mysqld --skip-grant-tables )
You can enter MySQL without a password.
And then there is
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
Re-kill MySQL and start MySQL in the normal way.




Previous:C# Dynamic State Reference DLL Method (Reprint)
Next:Intrusion Penetration: Application of HTTP headers
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com