Forum: 

MYSQL On LAMP Appliance - Moving the data files

Chris Shiplett's picture
Can someone point my to a quick tutorial on the proper way to move the MYSQL data files. I want to move them to my elastic storage connected drive. I've followed a couple of step by step tutorials I found online googling "move mysql datafiles," but they don't seem to work. I'm looking for something specific to this appliance. 2. How do I turn on error logging in the mysql startup script. Thanks! Chris
Liraz Siri's picture

I think you can use an ebsmount hook to do what you want. ebsmount hooks are scripts that are automatically run when you attach and EBS volume. Try something like this:

#!/bin/bash

/etc/init.d/mysql stop
mount --bind /media/ebs/.../mysql /var/lib/mysql
/etc/init.d/mysql start

Now after you connect your EBS volume /var/lib/mysql is really that directory inside your EBS volume as far as the operating system concerned.

Post new comment