• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Backup Failed: Failed to execute backup database

Joooop

New Pleskian
Hello,
Plesk daily backup failed with following message:

Code:
[4273]: 18:42:32 ERROR 75f73cb0-b085-4023-8368-fbd58f7405e7 Failed to execute backup database
.....
mysqldump: Got error: 1045: Access denied for user 'admin'@'localhost' (using password: YES) when trying to connect

I run the following query:
Code:
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "select d.name,dbs.host, dbs.type, db.name,du.login,a.password from domains d left join data_bases db on db.dom_id=d.id 
left join DatabaseServers dbs on db.db_server_id=dbs.id left join db_users du on db.default_user_id=du.id left join accounts a on du.account_id=a.id where d.name='xxxDomainxxx'"

result was as below:
Code:
+--------------+-----------+-------+-----------+-----------+----------------------------------------------------------------+
| name         | host      | type  | name      | login     | password                                                       |
+--------------+-----------+-------+-----------+-----------+----------------------------------------------------------------+
| xxxDomainxxx | localhost | mysql | xxxDB1xxx | xxxUS1xxx | $AES-128-CBC$o4Gd4ZI8k8SeMNVKmLNDuQ==$VwnB4gKOz8esUE3d98aQYg== |
| xxxDomainxxx | localhost | mysql | xxxDB2xxx | xxxUS2xxx | $AES-128-CBC$KGcIyF/zY1D52XwDY/mjyA==$PshC5RQJTbfL1ZWTVWo6rw== |
+--------------+-----------+-------+-----------+-----------+----------------------------------------------------------------+

then I tried to get backup manually but I got the same error:
Code:
>mysqldump xxxDB1xxx -uxxxUS1xxx  -p$AES-128-CBC$o4Gd4ZI8k8SeMNVKmLNDuQ==$VwnB4gKOz8esUE3d98aQYg== -hlocalhost  > testdump 
res:
mysqldump: Got error: 1045: Access denied for user 'xxxUS1xxx'@'localhost' (using password: YES) when trying to connect

then I tried to use plesk admin user to get a manual backup:
Code:
mysqldump xxxDB1xxx  -uadmin -p`cat /etc/psa/.psa.shadow`  -hlocalhost > testdump
res: 
Done! with no error.


now I'm confused!
database user could not make a backup, I tough maybe its password saved incorrectly, so I reset xxxUS1xxx password with plesk panel but nothing changed.
there is one more strange thing! in the log file plesk told that the admin user got an access denied, but as I see admin user could make a backup with no error.
any Idea?
 
The issue may be caused by an exceedingly long Plesk "admin" user password.
You can retrieve and check it with the /usr/local/psa/bin/admin --show-password command.
 
setting a shorter password (now 8 characters instead of 12) fixed the issue for us. the backup last night was successful.
this should still be considered a bug though.
 
Last edited:
what is the difference between a scheduled and a manual backup?
last night, the weekly scheduled backup failed again with the same error message as before: "Failed to execute backup database"
the manual backup last week worked (see my last post).
this is really getting annoying.
 
Hello,
I hope so.
i my case the problem exist yet and dump log is full of following error:
Code:
mysqldump: Got error: 1045: Access denied for user 'admin'@'localhost' (using password: YES) when trying to connect
I googled it around the web but fond nothing.

any idea?
 
What about following command in CLI:

# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > /root/psa.sql
 
Strange. I suggest you contact Support Team. Experienced supporters will check and fix this issue directly on your server.
 
solution

Hello,
Finally.... :)
if your get "Access denied for user 'admin'@'localhost'" in your backup log file, and if you do not have any '#' character in your admin password, you have same problem.
Make sure that there is no /root/.my.cnf file with MySQL password. Plesk uses environment variable to pass the password to MySQL server, but the .my.cnf file has greater priority and MySQL uses the password from the file. If it does not match, restoration fails.
you can find related Plesk KB here: http://kb.parallels.com/en/1657

Sincerely yours,
Mehran
 
Thanks for the feedback, Mehran.
We indeed had a /root/.my.cnf file with the password in it, like we do on every server (but those don't run Plesk...), to make admin life easier.
We'll have to wait until monday (weekly backup runs sunday night) to see if this solves the backup problem, but it did already solve another problem we had with this server recently which is decribed here
http://forum.parallels.com/showthre...ith-50plesk-daily-job&highlight=50plesk-daily
This issue with the cronjob is now gone after removing the .my.cnf file.
 
Back
Top