Created
February 16, 2016 17:28
-
-
Save mayeenulislam/f5bb5a3c266e945f82a8 to your computer and use it in GitHub Desktop.
Change mySQL password without SQL manager or PHPmyAdmin for WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tutorial by: nanodesigns (@nanodesigns) | |
* URL: http://tuts.nanodesignsbd.com/change-wordpress-password-without-sql-manager/ | |
* by: Mayeenul Islam (@mayeenulislam) | |
*/ | |
//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's 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