- Newest
- Most votes
- Most comments
Were you able to log in before?
In that case, it may be possible to restore and use a snapshot of LightSail, if one is left.
It is also possible to change the password of a WordPress user directly by executing SQL statements, if it is possible to access the database used by WordPress.
However, work with databases can be dangerous and should be done with caution.
A sample SQL statement is provided below.
UPDATE wp_users SET user_pass = MD5('New Password') WHERE user_login = 'WordPress Admin User';
Hello,
You can modify the WordPress password through an SSH session and the use of the WordPress CLI. The Lightsail console provides a web-ssh client you can open in 1-click.
Once in the instance, you need to execute the following command:
Command:
sudo wp user update user --user_pass=YourNewPasswordGoesHere --skip-email
Expected output:
Success: Updated user 1.
If you have other user(s) and want to change their password, you need to supply the correct name. In that case, please replace "UserName" and "YourNewPasswordGoesHere" with their respective values.
sudo wp user update UserName --user_pass=YourNewPasswordGoesHere --skip-email
The above would literally change the password for your default user, which is named user. The new password would be "YourNewPasswordGoesHere" so please replace that with your chosen new password.
I hope this resolves your issues. Please advise if you are still blocked. -Andy
If you have additional wordpress user issues you may be able to address them through the wp cli. The relevant "wp user" command is documented here: https://developer.wordpress.org/cli/commands/user/
When I run the command, switching out the "YourNewPasswordGoesHere" for a new password, it seems to just run indefinitely without ever actually updating the password.
I have not encountered an issue with WP CLI hanging before so I can't speak to that. Have you tried using the "wp user..." commands to do other actions? You may want to try creating an entirely new admin user and see if that works. If it does, you could then delete other user(s).
If you omit user_pass it'll generate a strong password for you automatically.
wp user create newName newEmail@example.com --role=administrator --user_pass=YourNewPassword
Success: Created user 2.
At that point I'd also check your user list and see if you have extras to delete.
Relevant content
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 9 months ago
I have been able to login before, the instance has been running for over half a year with no issues and only recently and suddenly stopped allowing me to login. How would I go about running from a snapshot without completely messing up my website as I do not wish to cause any damage to the site.
It is possible to create a new LightSail from a snapshot using the method in this document. https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-create-instance-from-snapshot
By the way, just to confirm, is the WordPress database running inside LightSail? In that case, you can restore LightSail from the snapshot, but if you have a WordPress database outside of LightSail using RDS or other means, you will need to restore the RDS from the snapshot.
It appears I do not have any snapshots to recover from as I never took a manual one and the automatic was turned off. Is there a way to fix my login without restarting the entire instance or remaking it from a backup?
If we can't modify the password from the WordPress screen, the only way is to change the database directly.