While restoring a cPanel account, I encountered the following error.
“Account Creation Status: failed (Sorry, a mysql user with the name already exists”
Please check for entries of that usernames in the following files and if there is any, remove those entries.
It did the trick for me. After removing these entries, execute the following command.
userdel -f username
This will also fix the error, “Account Creation Status: failed Sorry, a user with the name already exists”