google-templateswordpress

Reset the WordPress administrator password

NOTE: A multi-tier environment typically consists of multiple servers. The steps below should be performed on the runtime server (the server instance running the application), which includes a mysql client. For more information on connecting via SSH, refer to the FAQ.

First, obtain the user ID for the WordPress administrator account from the command line:

$ mysql -u root -h DATABASEHOST -p bitnami_wordpress -e "SELECT * FROM wp_users;"

Replace the DATABASEHOST placeholder with the host where the database is running.

Then, use the command below to reset the administrator password from the command line.

$ mysql -u root -h DATABASEHOST -p bitnami_wordpress -e "UPDATE wp_users SET user_pass=MD5('NEWPASSWORD') WHERE ID='ADMIN-ID';"

Remember to replace the DATABASEHOST placeholder with the host where the database is running, the NEWPASSWORD placeholder with your desired password and the ADMIN-ID placeholder with the user ID obtained from the first command.

To obtain the hostname where the database is running, you can execute the following command

$ sudo cat /opt/bitnami/wordpress/wp-config.php | grep 'DB_HOST'

You should see output similar to this:

define('DB_HOST', 'provisioner-peer:3306');

In this case, the DATABASEHOST placeholder should be replace by “provisioner-peer”.

Last modification August 30, 2019