/var/lib/mysql/ibdata1 too big

morteza

Member
Dec 8, 2009
20
1
51
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?
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
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

ln -s /home/mysql /var/lib/mysql
4) And start the MySQL on your server


Thank you :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
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.