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.

Database removed but still shows in CPanel

Discussion in 'Database Discussions' started by RCraft, Jul 10, 2011.

  1. RCraft

    RCraft Well-Known Member

    Joined:
    Nov 7, 2010
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Hey folks,

    I have an interesting issue. Somehow a customer ended up with a database that had periods in it. They decided they wanted to remove it, and it was deleted (manually, by removing it from /var/lib/mysql), but for some reason it still shows in their CPanel account. Logging into phpmyadmin from WHM, the database isn't listed there, nor is it on the server at all at this point. Is there a cache somewhere that needs to be cleared in order to remove the database entry from their CPanel?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you try issuing the following to see if this clears up the issue:

    Code:
    /usr/local/cpanel/bin/setupdbmap
    If that does not correct it, then please go to /var/cpanel/databases location and run this command to check for the database still existing:

    Code:
    cd /var/cpanel/databases
    cat username.yaml
    Here username is the cPanel username for the account.

    Next, in that same /var/cpanel/databases location, check for any existence of the database:

    Code:
    grep "databasename" /var/cpanel/databases/*
    I did wonder if there was a reason the database was manually removed. This breaks cPanel's database mapping for databases to users to remove one from /var/lib/mysql, so was the database not removable in cPanel > MySQL databases area?

    Thanks!
     
  3. RCraft

    RCraft Well-Known Member

    Joined:
    Nov 7, 2010
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Sorry for the delay in this. The reason the database was manually removed was because it somehow was created with a . in it. They entered the date in the database name so it was something like user_db.7.10. and CPanel would not delete the database. MySQL doesn't even support databases with a . in the name. so the whole situation was pretty bizarre.

    I ended up finding the database in the user.yaml file and as soon as this was deleted from it and the changes saved the database vanished from their control panel, so that was the missing link.

    Thanks.
     
Loading...

Share This Page