Skip to content

Instantly share code, notes, and snippets.

@lrhache
Created April 15, 2015 02:39
Show Gist options
  • Save lrhache/12e5ae9f056d0200a1a7 to your computer and use it in GitHub Desktop.
Save lrhache/12e5ae9f056d0200a1a7 to your computer and use it in GitHub Desktop.
Set MySQL to EBS storage
sudo service mysql stop
sudo mkdir /ebs1/etc /ebs1/lib /ebs1/log
sudo mv /etc/mysql /ebs1/etc
sudo mv /var/lib/mysql /ebs1/lib
sudo mv /var/log/mysql /ebs1/log
sudo mkdir /etc/mysql /var/lib/mysql /var/log/mysql
echo "/ebs1/etc/mysql /etc/mysql none bind" | sudo tee -a /etc/fstab
sudo mount /etc/mysql
echo "/ebs1/lib/mysql /var/lib/mysql none bind" | sudo tee -a /etc/fstab
sudo mount /var/lib/mysql
echo "/ebs1/log/mysql /var/log/mysql none bind" | sudo tee -a /etc/fstab
sudo mount /var/log/mysql
sudo service mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment