Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am in the process of moving my MySQL databases from SAS Drive to a SSD drive. Currently I am running Centos 5.6 with Cpanel Installed. I have though about moving the data from /home(sas) to /home2(ssd) and then updating the my.cnf to point to the correct datadir location. But I also considered just creating a symlink to point to the new location. My question is which would be better to do? Are there advantages or disadvantages to doing either way?

share|improve this question
up vote 0 down vote accepted

The performance loss in dereferencing the symlink should occur so infrequently as to be negligible.

If you have a standard path to your datadir on all servers (say, /mysql ) then adding the symlink is a good idea just to make your sysadmin's lives easier but this is irrelevant to your question as you could still put the true path in your my.cnf.

I can't think of any other effect that either of your two options could have.

share|improve this answer

If you do a symlink, your datas will stay on the SAS drive, so no more preformance than today. So stop MySQL, move all the datas to the new drive. You can do a symlink if you want to the new dir, but I think it is not complicated to change your my.cnf to use the right dir.

share|improve this answer

Adding the symlink would allow you to keep 'standard' config which has a few benefits:

  • Updates and upgrades will be easier. It's not common but there are some cases where a config file can be overwritten on purpose or accidentally so leaving the path standard is always good.
  • If you're running other programs that make use of your DBs such as monitoring software, the will expect to find the DBs in /var/lib/mysql. You can likely reconfigure them to your new location, but if you symlink that's one less thing you have to do.

I don't think there are any downsides with respect to speed for symlinks. I supposed there is some sub-nano-second processing time to deference a symlink but I can't imagine it would ever be noticeable.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.