Reset WordPress credentials on AWS lightsail

Keywords: General - AWS - Technical issue - Credentials
Description:
I’ve used wp all in one plugin to migrate my site to aws lightsail. However, it also migrated the old credentials which was owned by the previous webhosting company. I’m not able to obtain those credentials. In this case, how can I reset my user and password to my new Wordpress?

Kindly get back to me

Hello @yijian36,

Thanks for using our Wordpress solution! You can change your Wordpress admin password directly from the database. Please check our guide on how to do so:

https://docs.bitnami.com/aws/apps/wordpress/administration/reset-wp-admin-password/

If you are also missing your database root password, you can change it following our Modify The Default MariaDB Administrator Password.

Regards,
Francisco de Paz

Hello @yijian36,

Yes, it is asking for the database password. If you don’t have it, please change it following the instructions on the second link I shared above.

Regards,
Francisco de Paz

Hello @yijian36,

At the end of the command, you only need to set the user ID that you are going to change the password of. In your case, it would be something like:

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

Also, just as advice, try not to share on the Internet any passwords that you will be using in your instance. Try to censor it when possible.

Regards,
Francisco de Paz

I’m trying to reset my mariadb password but when I key in this line

UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root';

I’m getting
-bash: syntax error near unexpected token (’`

Hello @yijian36,

As described in the guide, you need to add that line and the FLUSH PRIVILEGES; one to a new file, you shouldn’t execute those lines directly in the console.

Regards,
Francisco de Paz

Issue resolved. Please close ticket