var directory too small to hold all the MySQL databases, will this solution work?

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
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.
 
Last edited:

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
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
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
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
Thanks Chirpy. Another question about this: So I suppose a regular account CP-restore will work as well under this circumstance?
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
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
Can anyone confirm if this is still required?
 

rachelm

Well-Known Member
Verifed Vendor
Jan 26, 2005
94
1
158
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.
 

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
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??
 

discovery

Active Member
Nov 11, 2008
28
0
51
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