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.

/var/lib/mysql/ibdata1 too big

Discussion in 'Database Discussions' started by morteza, Jul 4, 2013.

  1. morteza

    morteza Member

    Joined:
    Dec 8, 2009
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    This is a general question, I was wondering if any of you guys can help me with. /var/lib/mysql/ibdata1 grows up to 9GB and more, and this leaves no disk space on /var partition. Is it possible to move this file to another partition and make a link in /var/lib/mysql instead? Or do you know any solutions without altering /var size?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, It's possible to change MySQL directory partition on your server using the following steps

    1) Stop the MySQL on your server

    2) Move your /var/lib/mysql directory to /home (other partition which have free space on your server)

    3) create the symbolic link of /var/lib/MySQL to your new MySQL directory location

    4) And start the MySQL on your server


    Thank you :)
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,707
    Likes Received:
    658
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Rather than symbolically linking that single file, you can move the MySQL data directory. You can find instructions for this on the following thread:

    Moving MySQL Data Directory

    Thank you.
     
Loading...

Share This Page