Results 1 to 4 of 4
  1. #1

    How to configure mysql to hold your databases on another partition on hard drive?

    Hi there,

    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..

    How do I do this?

  2. #2
    The following thread will help you to change your mysql data directory:

    Just an overview to change location of mysql data directory:

    [1] Stop mysql service.
    [2] Copy all mysql data to a new location and change ownership of new data folder to mysql:mysql
    [3] Open your mysql config file (my.cnf) and change the location for datadir to new one.
    [4] Create a symlink to point /var/lib/mysql to point to new location.
    [5] 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.

    || Web Hosting Blog - Web Hosting security & latest web hosting industry Announcements
    || Web Hosting Discussion - A Web Hosting community

  3. #3
    Thanks!! Appreciate it.

  4. #4
    Join Date
    Dec 2006
    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.

Similar Threads

  1. MySQL - Hard Drive or CPU Bottleneck
    By Kaiousama in forum Programming Discussion
    Replies: 12
    Last Post: 10-04-2009, 08:40 AM
  2. HELP! MAC and FAT32 Partition on the same hard drive...
    By DevilDog in forum Web Hosting Lounge
    Replies: 0
    Last Post: 07-07-2005, 10:19 PM
  3. Hard drive partition for CPANEl/WHM
    By cannibal in forum Hosting Security and Technology
    Replies: 2
    Last Post: 09-28-2004, 12:43 AM
  4. H-Sphere installation - hard drive partition
    By sam75 in forum Hosting Software and Control Panels
    Replies: 1
    Last Post: 08-18-2004, 04:33 PM
  5. Best partition For 80GB hard drive
    By sam75 in forum Hosting Security and Technology
    Replies: 4
    Last Post: 07-10-2004, 09:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts