Skip to content

Instantly share code, notes, and snippets.

@krzysztofjablonski
Forked from kurisuchan/gist:1262135
Last active December 18, 2015 00:59
Show Gist options
  • Save krzysztofjablonski/5700562 to your computer and use it in GitHub Desktop.
Save krzysztofjablonski/5700562 to your computer and use it in GitHub Desktop.
Ramdisk for mysql
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux
# Log in as root
# Mount ramdisk folder in RAM
mkdir /tmp/ramdisk
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/
# Move MySQL data
mv /var/lib/mysql /tmp/ramdisk/mysql
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql
# Update permissions
chmod -R 700 /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
restart mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment