How to configure mysql to hold your databases on another partition on hard drive?
I have a server that is running linux with cpanel and I am running out of space on a partition.
I was getting this error:
Drive Warning: /dev/sda3 (/var) is 83% full
I looked in the folder and went to /var/lib/mysql and noticed that I have about 6 databases that are a little over 1 GB each. The sda3 partition only has a capacity for 9.9 GB and I was suggested to configure mysql to hold my databases on another partition that has more space..
Just an overview to change location of mysql data directory:
 Stop mysql service.
 Copy all mysql data to a new location and change ownership of new data folder to mysql:mysql
 Open your mysql config file (my.cnf) and change the location for datadir to new one.
 Create a symlink to point /var/lib/mysql to point to new location.
 Start mysql service.
Make sure you keep the old data so that if anything goes wrong you can reverse the changes. If you do not have good technical skill, I suggest you to hire someone.
Alternatively at step 3, you can copy individual databases to different locations and create symlinks for the individual database folders. That lets you put different databases on different disks (which may get better performance if you have multiple physical disks) as well as allievate space concerns.
If you move just databases you don't need to edit my.cnf.