Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to find unmapped databases?

Discussion in 'Database Discussion' started by stormy, Jan 3, 2017.

Tags:
  1. stormy

    stormy Well-Known Member

    Joined:
    Nov 22, 2003
    Messages:
    126
    Likes Received:
    8
    Trophy Points:
    168
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    Due to some problems in a migration, I've found that there are unmapped databases, as well as some missing databases too.

    Is there a command I can run to find unmapped databases, or mapped but nonexistent databases?

    I would like to crosscheck the databases that cPanel has mapped with the ones that actually exist in MySQL.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,301
    Likes Received:
    1,847
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    There's no script or command available that will list databases that aren't associated with a cPanel account, however you can find a list of databases that are associated with cPanel accounts with a command such as:

    Code:
    whmapi1 list_databases
    This WHM API 1 function is documented at:

    WHM API 1 Functions - list_databases - Software Development Kit - cPanel Documentation

    You'd need to manually compare this with the databases stored in the /var/lib/mysql/ directory to see which databases aren't associated with a cPanel account, or develop a custom script that cross-references the results.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice