Skip to main content

Inexisting databases and users showing on cpanel

Comments

3 comments

  • cPRex Jurassic Moderator
    Hey there! cPanel doesn't have any integration with the MySQL workbench tool, so it's always a good idea to remove users and databases directly from the cPanel interface whenever possible. If there is cruft left of the users you may need to check a few different areas to ensure they are removed. One would be the /var/cpanel/databases area of the system, as the username.json file in that directory stores the user access for each database and account. You may also need to check the MySQL user table itself to see if there are still entries there, which can be done with this command from the terminal: mysql -e "select * from mysql.user" | grep USERNAME
    Just replace the "USERNAME" portion with what user you want to search for. That's where I would start my hunt for this, but let me know if that doesn't get things resolved!
    0
  • UnknownFan
    Hi, thanks for the reply. /var/cpanel/databases files have the old data that I need to remove. Can I just delete all the json's and .caches ? Do I need to rebuild them later? There are no databases or users being used. So Deleting should be ok. right?
    0
  • cPRex Jurassic Moderator
    Sorry, I should have been more clear on that. You wouldn't want to remove those files completely, but just edit them to remove the affected database user. Even if there should be no users, you'll still want that file to exist. I'd recommend backing up the file first before making any edits. Here's an example of the content of the file for a user that has no databases, and only includes the default user connection string: {"PGSQL":{},"MYSQL":{"owner":"username","dbs":{},"dbusers":{},"noprefix":{},"server":"1.2.3.4"},"version":1}
    0

Please sign in to leave a comment.