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 directory too small to hold all the MySQL databases, will this solution work?

Discussion in 'General Discussion' started by jols, Sep 19, 2008.

  1. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Currently using:
    WHM 11.23.2 cPanel 11.23.6-R27225
    REDHAT Enterprise 5.2 i686 on standard - WHM X v3.1.0

    Our /var directory is over 90% full, even though the /home directory is less than half full. This is due to all the large databases being kept by the hosted accounts in /var/lib/mysql

    And the databases in /var are growing every day. The /var directory will probably fill up to 100% early next week.

    Okay, so how about if we solve this using a symlink, like this?:

    mv /var/lib/mysql /home/mysql
    ln -s /home/mysql /var/lib/mysql

    Any problem with that for a solution?

    Thanks much.
     
    #1 jols, Sep 19, 2008
    Last edited: Sep 19, 2008
  2. ashokpomnar

    ashokpomnar Active Member

    Joined:
    Sep 30, 2006
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Yes, It will work without any problem.
     
  3. Kailash1

    Kailash1 Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    252
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Do NOT forget to stop MySQL service before you start moving the data otherwise there is a chance that the database might be corrupted.

    Kailash
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    In the past you also had to add the following directive to /etc/my.cnf otherwise the cPanel backups won't backup the entire mysql database correctly (if you have that set):

    datadir=/home/mysql
     
  5. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Thanks Chirpy. Another question about this: So I suppose a regular account CP-restore will work as well under this circumstance?
     
  6. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    Can anyone confirm if this is still required?
     
  7. rachelm

    rachelm Well-Known Member

    Joined:
    Jan 26, 2005
    Messages:
    94
    Likes Received:
    1
    Trophy Points:
    8
    I haven't had to use it, but you could always try it without, if it doesn't work the you may need to add the line.

    Also, prior to stopping mysql you should stop checksrvd first, otherwise it will restart mysql after a short period which could screw up the copying of the mysql files etc.
     
  8. Ghulam Yaseen

    Ghulam Yaseen Well-Known Member

    Joined:
    Mar 14, 2008
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Karachi,Pakistan
    linux thirst

    Hello :),

    Yes, this is optionally required because even then you have created the sym link means the data will be available from both dir:cool:

     
  9. sharmaine001

    sharmaine001 Well-Known Member

    Joined:
    Jun 23, 2006
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    sorry to dig this post but according to other forum, the setting of datadir in my.cnf is required (not optional) because of the cpanel backups.

    Can someone from cPanel here confirm that if I symlink /var/lib/mysql to /home/mysql it will still backup the "Per account and entire mysql directory" using cpbackup??
     
  10. sharmaine001

    sharmaine001 Well-Known Member

    Joined:
    Jun 23, 2006
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    can someone from cPanel answer this for me please??
     
  11. discovery

    discovery Active Member

    Joined:
    Nov 11, 2008
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    search the forums; there is a detailed post with all steps needed to change the /mysql location

    I've done that and moved to /home/mysql and all works just fine: backup, space count into cpanel and had no problem for about one month now

    I'll try to find for you, too bad I didn't marked
     
  12. discovery

    discovery Active Member

    Joined:
    Nov 11, 2008
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
Loading...

Share This Page