Dienstag, 14. April 2020

MYSQL MD5 Passwort reset in database

In case you have to alter a MD5 password in a mySQL table


  1. Create the MD5 hash of your password
  2. Create a file called password.txt, containing nothing but the new password
  3. Having a MACmd5 -q ./password.txt; rm ./password.txt 
  4. Login your database 
  5. mysql -u root -p
  6. show databases;
  7. use (name-of-database, i.e. mailer);
  8. show tables; 
  9. select * from users; (to see what is in your DB)
  10. UPDATE users SET password=”(MD5-string-you-made)” WHERE ID = (id#-of-account-you-are-reseting-password-for);
  11. “SELECT ID, user_login, user_pass FROM (name-of-table-you-found);” (to confirm your changes)