Changing value of datadir on a cpanel production box

hariskhan

Well-Known Member
Apr 15, 2004
146
0
166
Hello,

This is a fbsd 5.4 box with cpanel's latest edition, recently installed.

I have my servers setup like the following;

/usr has about 20 GB, /var has about 8 GB space, /home has about 160 GB of space

To my knowledge, cpanel runs /scripts/upcp every 7 hours (it was once every 24 hrs in the old days)

I need to store all the mysql databases on /home, so there wouldn't be a limitation of space, if the databases for the portals I host grow further up.

I have so far no custom settings mentioned in /etc/my.cnf on cpanel boxes.

My question are;

- If I make a change like datadir=/home/db (or some folder under /home) and restart mysql daemon, will it be over-written by cpanel when /scripts/upcp runs? (Does cpanel take into account the changes I'v made in /etc/my.cnf or over-write them to its factory defaults)

or

would those changes stay ...

- In what event would those changes be over-written? (as a precaution)
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
cPanel doesn't touch /etc/my.cnf so you can make those changes there. The alternative is to move /var/lib/mysql to /home/mysql (remove /var/lib/mysql) and create a symlink to it:

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

This avoids configuration file changes.

/scripts/upcp should only be running every 24 hours. If it is running more frequently you need to check the root cron job.
 

eger

Well-Known Member
Feb 28, 2003
128
0
166
I ran into a similar issue on a FBSD cPanel box where I ran out of /var space for mysql. I backup up my db dir then moved it to the /home partition and created a symlink just as Chirpy suggested and it worked just fine.