I'm wondering how I can change the default location of the mysql db when I install Mysql using apt on debian. EC2 instances set up /mnt to have the majority of disk space, leaving only 10gb for /.

So I'd like for the DB to be stored in /mnt somehow. The configs etc can stay where they install by default, I just want the actual disk storage to be on /mnt.

Any tips?

Right, so I found that the datadir directive is where mysql stores it's DB's, so in /etc/mysql/my.cnf i changed datadir to /mnt/mysql. But starting mysql now fails and I can't see anything in the mysql.err log, or any mysql log for that matter. Any thoughts?

link|improve this question

80% accept rate
feedback

2 Answers

up vote 1 down vote accepted

Ok, so I figured it out. Had to copy over the files from the original mysql data dir (except the ib_xx files) and needed to chown mysql:mysql all those files. Works like a charm now!

link|improve this answer
Don't forget that you loose the data stored on the local disks in EC2. If you want to keep that data around, you should look into using an EBS (Elastic Block Store) for your data. – jedberg Oct 10 '09 at 16:28
what do you mean you lose the data? when you shut down the instance? or delete the instance? This is my first EC2 so I don't really know all the ins and outs – brad Oct 10 '09 at 17:46
feedback

You probably already figured it out by now, but he meant that you lose your data when you terminate the instance.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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