The full error message is output when attempting to restore an account and reads:
The "Account" restore module failed because of an error: Failed to create the account: (XID xxxxxx) The system could not create the user "USER" because it conflicts with an unmanaged MySQL database user. at /usr/local/cpanel/Whostmgr/Accounts/Create.pm line 1275.
This issue is caused by there being a MySQL database or MySQL user that starts with or is identical to the username being restored.
You can find the MySQL user that is conflicting with the following procedure:
First, enter MySQL's command-line interface by entering the following command as root:
Then, tell MySQL that you wish to use the mysql database (that one that holds all the internal MySQL records) with the following command at the MySQL prompt:
> use mysql;
Now, enter the following queries to find the records we're looking for:
> select User, Host from user where User like "USER%";
> select Host, Db, User from db where Db like "USER%";
The % at the end is the MySQL wildcard character. So you will match USER, USER1, USER_db, etc.
Once you know what needs to be removed, your systems administrator or database administrator can determine if the databases and users are needed, and how best to safely remove or rename the databases and database users so that no further conflict exists.