The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to find unmapped databases?

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

Tags:
  1. stormy

    stormy Well-Known Member

    Joined:
    Nov 22, 2003
    Messages:
    122
    Likes Received:
    6
    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:
    37,064
    Likes Received:
    1,288
    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.
     
Loading...

Share This Page