Community Forums
Connect with us on LinkedIn
  
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Sep 2002
    Posts
    580

    Default ibdata1

    What exactly is the file /var/lib/mysql/ibdata1 used for?

    It is getting quite big in soms of our servers.

  2. #2
    Member Danny_T's Avatar
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    181

    Default

    MySQL databases of InnoDB format.
    Net Tuning (Dutch)
    Official cPGS GameServer Mirror
    *New* Virtual Private Server hosting

  3. #3
    Member
    Join Date
    Sep 2002
    Posts
    580

    Default

    Is innodb the default format for mysql databases?

  4. #4
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    The default table type is MyISAM. One must manually specify INNODB when creating a table to user that table type. By default, MySQL stores all INNODB tables in a once, continuously growing, file in /var/lib/mysql. This behavior can be altered by setting:

    Code:
    [mysqld]
    innodb_file_per_table
    in /etc/my.cnf and restarting the MySQL service. This will cause new INNODB tables to be created in the directory of the database. e.g /var/lib/mysql/user_dbname/table_name.ibd rather than the central file. Tables that exist already in the central file must be:

    1. Dumped
    2. Dropped
    3. Restored

    in order to be moved to the per-database file.

    You can learn more here:

    http://dev.mysql.com/doc/refman/5.0/...iguration.html

  5. #5
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Quote Originally Posted by cpanelkenneth View Post
    The default table type is MyISAM. One must manually specify INNODB when creating a table to user that table type. By default, MySQL stores all INNODB tables in a once, continuously growing, file in /var/lib/mysql. This behavior can be altered by setting:

    Code:
    [mysqld]
    innodb_file_per_table
    in /etc/my.cnf and restarting the MySQL service. This will cause new INNODB tables to be created in the directory of the database. e.g /var/lib/mysql/user_dbname/table_name.ibd rather than the central file. Tables that exist already in the central file must be:

    1. Dumped
    2. Dropped
    3. Restored

    in order to be moved to the per-database file.

    You can learn more here:

    MySQL :: MySQL 5.0 Reference Manual :: 13.2.2 InnoDB Configuration

    So what you are saying is that we have to dump, drop and restore every database on the server to get around having giant ibdata1 files in the very limited /var partition?

    Isn't there some other way to shrink just this one file without having to upset the entire applecart?

    Barring that, could we just move ibdata1 to the home directory and then symlink from /var/lib/mysql ???

Similar Threads & Tags
Similar threads

  1. Replies: 3
    Last Post: 05-17-2010, 05:49 PM
  2. ibdata1 - move and symlink? Will this work?
    By jols in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 05-17-2010, 07:52 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube