Super User is a question and answer site for computer enthusiasts and power users. 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 have mysql data mounted to


And what I want is to move it to


My plan is following:

  1. Stop mysql.
  2. Rsync from /var/lib/mysql to /fast/mysql.
  3. Change my.cnf to point to /fast/mysql.
  4. Run mysql.

Are there any problems with my plan?

share|improve this question
you could move the data and do a symbolic link from the original location. – Wolfgang Fahl Mar 27 '13 at 19:09
@WolfgangFahl, yup, symbolic link seems fast solution. As I understood you suggest to make link from /var/lib/mysql folder to /fast/mysql folder. I mean particularly folder links, not file links? – Jevgeni Smirnov Mar 28 '13 at 7:38
mv /var/lib/mysql /fast/mysql;ln -s /fast/mysql /var/lib/mysql - see answer below – Wolfgang Fahl Mar 28 '13 at 8:03

If you're running apparmor, you'll need to tell it that MySQL is allowed to access the files at the new location.

Your distribution may be configured differently, but on Ubuntu 12.10, you'll need to edit this file:


share|improve this answer

you might want to use a symbolic link

mv /var/lib/mysql /fast/mysql
ln -s /fast/mysql /var/lib/mysql
share|improve this answer
The only question, why I just can't use point 3 from my plan? I mean why changing value in my.cnf is not good solution and I need to use link? – Jevgeni Smirnov Mar 28 '13 at 8:43
My answer is about the move part more than the cnf part. You proposal was copying, I don't know whether you where intending to copy. – Wolfgang Fahl Mar 28 '13 at 9:33

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.