Page 1 of 1

Move mysql data directory

PostPosted: 25. February 2009 15:29
by aroxo
He/allo all!

A quick one which has been vexing me. I've got a standard XAMPP install on an AWS EC2 instance. Now EC2 is funny because you don't get a lot of storage with it and you have to buy extra storage. This storage gets mounted on the instanced in the /vol/ directory. The idea is that you put all your data in it (its cheaper, faster, and it scales).

I've moved htdocs (easy), but I'm struggling moving the mysql directory. I've been able to phyiscally move /opt/lampp/var/mysql and I've updated all references in my.cnf to point to the new location (the sockets and the innodb stuff) and mysql will start, but nothing can connect.

I've then tried leave both folders where they are - namely /vol/mysql and /opt/lampp/var/mysql and then pointing innodb db to /vol and the sockets in opt. But no success.

Any ideas how to move the mysql directories?!

Thanks/Danke in advance!

Matt.

By the way if you use Twitter, feel free to sign up for the alpha trial of Twilie (on http://twilie.com) which is the app running on XAMPP. Twilie will manage all the links you send and receive on Twitter.

Sorry - couldn't resist the plug!

Re: Move mysql data directory

PostPosted: 27. February 2009 12:13
by aroxo
Ok. Done. Here's what I did (please don't follow verbatim, just to give you an idea):

1. /opt/lampp/lampp stop
2. mkdir /vol/mysql
3. chown -R [mysql user] /vol/mysql
4. mv the databases in /opt/lampp/var/mysql - but not all the other files
5. nano /opt/lampp/etc/my.cnf and update the following:
- socket
- socket (again)
- innodb_data_home_dir
- innodb_log_group_home_dir
6. /opt/lampp/lampp start

Hope this helps someone else in the future!

@aroxo.