Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    29

    Question Database gone after deleting ibdata files

    I have a bit of emergency and all help is sincerely appreciated.

    Problem description:

    We had 2 databases under innodb engine and the rest under MyISAM. I needed to clean up the very high space usage in ibdata* files. The developer told me about 1 DB only and I duly backed it up using mysqldump.

    Then I deleted ibdata* and restored the DB from mysqldump.

    So far so good.

    Now I have learnt that we missed out 1 DB completely. As expected this DB is showing corrupted after the ibdata files were recreated.

    I have tried to restore monthly and weekly backups but they are unable to restore the missing DB.

    Requests:

    1. Does the CPanel daily/weekly/monthly backup process not backup the InnoDB databases?

    2. If it does, why can't my DBs come back after a restore?

    3. Is there any manual process to get the data back? Some of it is very vital and we will have a very tough time recreating the data manually.

    TIA

  2. #2
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb Re: Database gone after deleting ibdata files

    Please note the InnoDB "ibdata" files should not be deleted simply to reduce disk usage; this is not safe under any circumstances.

    If the database was not already corrupted at the time of backup, then I would consider dropping (removing) the existing corrupt database and re-create it using available full backups.

    cPanel backup features make it possible to backup both account databases and the entire MySQL data directory; if one or both of these are enabled in your backup configuration I would use the saved backups to restore from.

  3. #3
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,093
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    cPanelDon, is the ibdata file included in the mysql directory backup? I thought by default it was stored under /etc?

    Unfortunately I think cPanel's defaults get the ibdata file badly wrong - it should default to having the following line in /etc/my.cnf to force separate data files per database:
    innodb_file_per_table

    ... but it doesn't, so you get mega file growth in ibdata which can easily become unmanageable!

    (Hi Naveen/Daryus etc!!)

  4. #4
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,093
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Oh - a helpful tip here is - never remove a file like this until sure. First, rename it and then gzip it, database files usually compress by 90%. Then when you're sure everything runs OK, after a day or two delete the renamed and compressed file! This technique works across the board - always rename rather than remove. Sorry, I know this is too late, hope it helps at least a little ...

  5. #5
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    Quote Originally Posted by brianoz View Post
    cPanelDon, is the ibdata file included in the mysql directory backup? I thought by default it was stored under /etc?
    Yes; if the MySQL data directory is set for backup, then if InnoDB is enabled the "ibdata" file would be included; here is an example set of directory paths assuming the backup directory is "/backup":
    Code:
    /backup/cpbackup/daily/dirs/_var_lib_mysql_/
    /backup/cpbackup/weekly/dirs/_var_lib_mysql_/
    /backup/cpbackup/monthly/dirs/_var_lib_mysql_/

    Quote Originally Posted by brianoz View Post
    Unfortunately I think cPanel's defaults get the ibdata file badly wrong - it should default to having the following line in /etc/my.cnf to force separate data files per database:
    innodb_file_per_table

    ... but it doesn't, so you get mega file growth in ibdata which can easily become unmanageable!

    (Hi Naveen/Daryus etc!!)
    cPanel does not define the default MySQL configuration; customizing of MySQL configurations is the choice and responsibility of the server administrator.

Similar Threads & Tags
Similar threads

  1. Ibdata 1
    By parag joshi in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-02-2009, 08:48 AM
  2. confirmation before deleting a database
    By ANewDay in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-18-2008, 10:26 AM
  3. Deleting exactuser from WHM have deleted exactuser2 database users !?!?!
    By docenta in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 06-30-2006, 01:32 AM
  4. Deleting files
    By nayeri in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-30-2003, 09:19 PM
  5. database flies are deleting everyday
    By shann in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-27-2003, 10:43 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube