- Newest
- Most votes
- Most comments
I just deleted the database instance and restore a new DB instance from snapshot. Fortunately, it is a development database.
Those two things may happen at the moment:
-
Change in Host for Root User: When granting privileges, the host for the root user may have been changed from '%' (allowing connections from any host) to a specific IP/host. This change restricts login access from other locations.
-
Database Instance Restart: Restarting the database instance won't resolve this issue because the root user configuration is stored within the data itself.
To address this, follow these steps:
-
Stop the MariaDB service:
sudo systemctl stop mariadb
-
Take a snapshot for backup:
sudo tar cvf backup.tar /var/lib/mysql
-
Modify the
mysql.user
table in the data files to reset the password and host for the root user. -
Start the MariaDB service:
sudo systemctl start mariadb
-
Check the
mysql.user
table after restarting to ensure the root user host is set back to '%' and try logging in again with the new password.
These steps should help you regain access to your MariaDB instance using the root user.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago