SSH into the instance and root into the database using
use mysql;
Select the user and password column from user table:
If the password column is not found, use authentication_string column name instead.
select user, authentication_string from user;
The output from this query will look like this:
+---------------+-------------------------------------------+
| user | authentication_string |
+---------------+-------------------------------------------+
| root | *BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX3 |
| mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| redmine | *2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXD |
+---------------+-------------------------------------------+
4 rows in set (0.00 sec)
Reset password by filling in the content within the curly bracket:
UPDATE mysql.user SET Password=PASSWORD('{password}') WHERE User='{username}';
Then do a flush to apply changes:
FLUSH PRIVILEGES;