aws-templateswordpress

Reset the WordPress administrator permissions

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.

Use the command below to reset the administrator permissions for the default user account from the command line:

$ mysql -u root -h DATABASEHOST -p bitnami_wordpress -e "UPDATE wp_usermeta SET meta_value='a:1:{s:13:"administrator";b:1;}' WHERE user_id=1 LIMIT 1;"

Remember to replace the DATABASEHOST placeholder with the host where the database is running.

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 an output similar to this:

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

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

Last modification April 17, 2019