Move mysql data directory

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Move mysql data directory

Postby aroxo » 25. February 2009 15:29

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!


By the way if you use Twitter, feel free to sign up for the alpha trial of Twilie (on 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!
Posts: 20
Joined: 25. February 2009 15:19

Re: Move mysql data directory

Postby aroxo » 27. February 2009 12:13

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!

Posts: 20
Joined: 25. February 2009 15:19

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 4 guests