When you want to create or restore from backup a cpanel account and get error message like “Account Creation Status: failed (Sorry, a mysql user with the name cpanel-user already exists.)” just go to your mysql database user and drop the user, but if the error message still appear, here some solution.
Solution 1:
Please check if that user cpanel-user is showing up in /var/cpanel/databases/ location:
1 |
grep cpanel-user /var/cpanel/databases/* |
If that user is already showing up in that location, it will prevent the account from restoring.
Solution 2:
Please check for entries of that usernames in the following files and if there is any, remove those entries.
1 2 |
/var/cpanel/databases/users.db /etc/dbowners |
It did the trick for me. After removing these entries, execute the following command.
1 |
userdel -f username |