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.

cPanel backup error - Unknown database

Discussion in 'General Discussion' started by raysolomon, Dec 15, 2010.

  1. raysolomon

    raysolomon Member

    Joined:
    Oct 12, 2006
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    WHM/cpanel does an FTP backup of one of my web sites remotely every night.
    The database is very big which accounts for most of its size.

    I have been getting the following errors for a couple months and not sure what the problem is.
    I am concerned that the backup tar.gz file may be missing some data even though the backup file finally gets uploaded successfully.

    Other web sites that are less in size do not have these errors in the log file.

    I already googled the error message, but found no solution.

    Are there any other different backup solutions that are more reliable than this?

    Any help on finding the cause of or fixing this error is appreciated.

    Code:
    .........
    .........
    .........
    .........
    Done
    Entering timeout safety mode
    Determining mysql dbs...DBD::mysql::st execute failed: Unknown database 'mydb' at /usr/local/cpanel/Cpanel/Mysql.pm line 1432.
    DBD::mysql::st execute failed: Unknown database 'mydb' at /usr/local/cpanel/Cpanel/Mysql.pm line 1432.
    
    Saving mysql privs...Done
    ...mysql version: 5.0......mysqldump version: 5.0......Done
    Storing mysql dbs...mydb.........
    /usr/bin/mysqlcheck: Got error: 1049: Unknown database 'mydb' when selecting the database
    (755 bytes) mydb_optins(1031138 bytes) mydb_main.........
    .........
    .........
    .........
    .........
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Is this the actual name of the site's database?
    I'm going to assume it's not. But even if you edited the name for your post, whatever the db name actually is is probably listed in your cPanel > MySQL Databases. What size does it show there, 0.00?

    I have seen this similar message in my log and noted that cPanel has found many long removed databases on multiple accounts. On one of my own accounts cPanel says I have 11 SQL Databases used. If I check in MySQL Databases I have 21 listed. I recognize the names on them, long ago killed. Back from the dead. But they do show as 0.00 in size.

    Not sure if this is helpful of course, but check to see if your live database is the same name as the one mentioned in the log, just to be sure.
     
  3. raysolomon

    raysolomon Member

    Joined:
    Oct 12, 2006
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Whoa! you were right.

    I had an empty 0.0 size database that was not being used for anything.
    Not sure how I failed to notice that.

    I deleted it.

    I bet that will fix the problem

    Thank you.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Sometimes. :p

    Happy to help.
     
  5. S-Combs

    S-Combs Well-Known Member

    Joined:
    Jun 10, 2004
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    I would like to add to this thread because I was receiving the same errors during backups on one server and traced the problem to deleting databases within root phpMyAdmin.

    I do a lot of script testing and not enough housekeeping so ended up with about 50 no longer used databases across a few separate cpanel accounts of my own. I decided to clean these out the other day and deleted them all using phpMyAdmin as the root user. I then started getting these same "Unknown database" errors during incremental account backups for every database I deleted.

    After finding this thread, I decided to log into the cpanel interface of these accounts and found that all of these deleted databases were still listed in cpanel as 0mb and had to be deleted from there as well.
     
  6. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Don't want to take it to another direction but cPanel has changed its db management significantly. cPanel db mapping is the new integration in cPanel. Often using this dbmap tool resolves the cPanel db listing mismatch issue. Link to the documentation below.

    http://www.cpanel.net/DBMappingWhitePaper_r10.pdf

     
Loading...

Share This Page