Product:
Search Type:

Upgrade to Plesk 8.2 failed with the "Duplicate entry 'localhost-admin' for key 1" error.

Article ID: 2013 
Last Review: Oct,31 2007
APPLIES TO:
  • Plesk 8.2.0 for Linux/Unix

SYMPTOMS

Upgrade to Plesk 8.2 fails with the following error:

===> Installing psa database
mysqld (pid 2064) is running...
 Trying to define valid mysql credentials...  Trying to establish test
connection... connected
done
 Trying to remove chunks from MySQL database... ERROR 1062 (23000) at line 3:
Duplicate entry 'localhost-admin' for key 1

ERROR while trying to remove chunks from MySQL database



CAUSE

This problem occurs if the record  for 'root' user exists in mysql.user table. Plesk tries to rename 'root' user to 'admin' and fails with the error.


RESOLUTION

Rename 'root' mysql user to some other and rerun the upgrade with '--force' option:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow `  mysql -e 'update user set user="root_user" where user="root";flush privileges;'
# rpm -Uvh --force ./*



 After upgrade is done, rename 'root' user back if you need it.

# mysql -uadmin -p`cat /etc/psa/.psa.shadow `  mysql -e 'update user set user="root" where user="root_user";flush privileges;'

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields