ERROR 1820 (HY000): Reset the Password Issue
ERROR 1820 (HY000): Reset the Password Issue in Percona Issues.
ERROR 1820 (HY000): Reset the Password Issue#
Reset the Password Using ALTER USER Statement Before Executing This Statement. MySQL database is prompting for a password reset when attempting to run any query after login.
Solution:
Reset the password using the following command:
-
Login to MySQL: Connect to your MySQL database using a MySQL client or command line.
mysql -u your_username -p -
Reset the Password: Execute the ALTER USER command to reset the password.
ALTER USER 'appsonedb'@'192.0.2.12' IDENTIFIED WITH 'mysql_native_password' BY '<password>';
Follow the below steps to resolve the issue:
-
Login to MySQL Database:
mysql -u appsonedb -pEnter the current password when prompted.
-
Reset the User Password:
ALTER USER 'appsonedb'@'192.0.2.12' IDENTIFIED WITH 'mysql_native_password' BY '<password>';
Percona Password Expiration#
Issue : The UI and CC services were not operational due to the Percona password expiration.
RCA: The CC and UI services failed to authenticate with Percona because the appsonedb password had expired.
Error found in the CC Nomad logs:
"Your password has expired. To log in you must change it using a
client that supports expired passwords."
Solution :
-
Create MySQL Initialization File : Create file named `mysql-init ` in the `a1home ` directory containing the command:
ALTER USER 'dbadmin'@'%' IDENTIFIED BY '<password>45'; -
Create Docker Entry point Script : Create a script named docker-entrypoint.sh in the a1home directory with the following content:
su mysql -c "mysqld --init-file=/tmp/mysql-init" -
Update Percona Nomad Configuration: Add the below two lines to the volume section of the percona.nomad file:
"/appsone/HEAL/docker-entrypoint.sh:/tmp/docker-entrypoint.sh", "/appsone/HEAL/mysql-init:/tmp/mysql-init", -
Restart Percona and Connect to MySQL : Restart the Percona service. And execute the below query to connect to MySQL:
mysql -h 192.0.2.56 -u dbadmin -P3309 -p'<password>45' -
Change Passwords for Users : After connecting to MySQL, execute the following commands to update user passwords:
ALTER USER 'dbadmin'@'%' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'192.0.2.32' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'192.0.2.33' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'192.0.2.34' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'192.0.2.35' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'10.191188.69.14530.14' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'192.0.2.36' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'192.0.2.37' IDENTIFIED BY '<password>'; ALTER USER 'appsonedb'@'10' IDENTIFIED BY '<password>';Note: After changing the passwords, login from each specified host using:
mysql -h 192.0.2.57 -u appsonedb -P3307 -p'<password>'If any errors occur during connection, follow the additional steps below:
DROP USER 'appsonedb'@'192.0.2.38'; CREATE USER 'appsonedb'@'192.0.2.38' IDENTIFIED BY '<password>'; GRANT ALL PRIVILEGES ON *.* TO 'appsonedb'@'192.0.2.38'; -
Cleanup Configuration : After successfully changing the passwords, remove the two lines added to the percona.nomad file and restart the services.