Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webtechriser/0d7421cdbb5abd444604b664e33ea81a to your computer and use it in GitHub Desktop.
Save webtechriser/0d7421cdbb5abd444604b664e33ea81a to your computer and use it in GitHub Desktop.
<?php
// Connect to mySQL First
$connection = mysql_connect( 'DB_HOST', 'DB_USER', 'DB_PASSWORD' );
// Select Database
mysql_select_db( 'DB_NAME' );
// Reset password with SQL UPDATE Query
$SQL = "UPDATE wp_users SET user_pass = MD5( 'newpassword123here') WHERE user_login = 'admin'";
// If everything is OK, your password will be reset
if( mysql_query( $SQL ) ) {
echo "Your password was succesfully reset!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment