Skip to content

Instantly share code, notes, and snippets.

@k2nr
Created December 20, 2013 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k2nr/8052100 to your computer and use it in GitHub Desktop.
Save k2nr/8052100 to your computer and use it in GitHub Desktop.
ramdisk mysql macOS hombrew
#!/bin/bash
RAMDISK_SIZE=1024 # MB
RAMDISK_BLOCKS=$((2048*$RAMDISK_SIZE))
RAMDISK_ROOT=/Volumes/ramdisk
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://$RAMDISK_BLOCKS` &> /dev/null
mkdir $RAMDISK_ROOT/mysql
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=$RAMDISK_ROOT/mysql --tmpdir=/tmp
mysql.server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment