(717) 288-7191
  • Facebook
  • Facebook
  • Contact
  • Account
    • Register
K9 WEBOPS
  • Cybersecurity
  • Support
  • Blog
Select Page

cPanel account restore issue – a mysql user with the name ” already exists

When trying to restore an account from a backup file from WHM, do you face this error ?

Account Restore Failed: “Account failure: Failed to create the account: The system could not create the user “xxx” because it conflicts with an unmanaged MySQL database user.”

If you face this error, you might need to verify if there is a user with the above name which might have been the result of an improper termination of the account.

Login to MySQL shell :

# mysql -u root -p ( find MySQL password from /root/.my.cnf )

mysql> use mysql;

mysql> select User, Host from user where User like '%xxx %'; ( Replace xxx with the user which you get when the error hits )

If the user exists, you might get a table like the following depending on the number of such ones :

+———-+——————- +
| User               | Host                  |
+———-+——————- +
| xxxx| xx.xx.xx.xx                     |
| xxxx| host.hostname.com |
| xxxx| localhost                         |
+———-+——————-+

Remove all these entries using commands similar to :

mysql> DROP USER 'xxxx'@'xx.xx.xx.xx'; ( the 2nd portion after @ indicates the IP address in this case )


mysql> DROP USER 'xxxx'@'host.hostname.com';
Query OK, 0 rows affected (0.01 sec)


mysql> DROP USER 'xxxx'@'localhost';
Query OK, 0 rows affected (0.00 sec)

Once this is completed, verify there are no more entries :

mysql> select User, Host from user where User like '%xxxx%';
Empty set (0.00 sec)

After this, attempt to restore the account from the backup.

If you still face an issue in restoring, check the file                                           ‘/var/cpanel/databases/users.db‘ and make sure the user is not listed there.

You should be able to restore the account now !

 

Subscribe

/ ( mm / dd )

Recent Posts

  • Don’t Let A Cyber Threat Sneak Past You.
  • AWS EC2 Instance – CentOS or Ubuntu for My Application?
  • Website not loading across some networks – Quick Fix
  • WHM / cPanel kicks me out !
  • Emails from whmcs fails – How to resolve them ?

Categories

  • Android
  • Apache
  • aws
  • cPanel/WHM
  • DNS
  • Featured
  • General
  • IIS
  • Mail service
  • Microsoft Windows
  • MySQL
  • OpenSource
  • Plesk
  • Servers
  • SQL
  • SQL Server Management Studio
  • SSH
  • Uncategorized
  • Virtualmin
  • VMware
  • Windows 10
  • Terms of Service
  • Privacy Policy
  • Contact
  • Facebook

Copyright © 2026 K9 WEBOPS