Reese Knowledgebase

get_admin_password failed (Resetting admin password)

View Kristian Reese's profile on LinkedIn

If you like this article, please +1 or Recommend via FB with the provided buttons above:

Article ID: 66
by: Reese K.
Posted: 28 Sep, 2012
Last updated: 19 Nov, 2012
Views: 1400

When logging into plesk, I was presented with this error on a customer account.  It seemed a bit awkward since it let me login, signifying that in fact the admin password entered was correct.  Nonetheless, the error simply states that it's unable to connect to database and that the function get_admin_password failed.

Unable to connect to database: get_admin_password() failed: file_get_contents() failed: mktime() [<a href='function.mktime'>function.mktime</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead

To correct it, login to the container and run this command:

~# /usr/local/psa/bin/init_conf -u -passwd <password>

If that doesn't work either because of command availability or if it simply didn't take, try another method:

# /usr/local/psa/admin/bin/ch_admin_passwd

Finally, the last attempt:

1. Modify the MySQL server settings in the file /etc/my.cnf and add the skip-grant-tables option in the [mysqld] section:


2. Restart the MySQL server:

# /etc/init.d/mysqld restart

3. Add new password to the /etc/psa/.psa.shadow file.

4. Reset the password in the service table of the MySQL server:

# /usr/bin/mysql -D mysql -e"update user set password=PASSWORD('`cat /etc/psa/.psa.shadow`') where User='admin';"

5. Delete the skip-grant-tables option from the /etc/my.cnf file.

6. Restart the MYSQL server:

# /etc/init.d/mysqld restart
This article was:   Helpful | Not Helpful
Prev   Next
How To recreate Apache's configuration files via command line...     Using vzstat to get real time rx/tx rates per CTID