Skip to content

Instantly share code, notes, and snippets.

@skyrocknroll
Created March 9, 2012 11:24
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 skyrocknroll/2006137 to your computer and use it in GitHub Desktop.
Save skyrocknroll/2006137 to your computer and use it in GitHub Desktop.
Loading the DB into memory.
Move the data directory to an in-memory filesystem.
In Linux, it’s usually in /dev/shm.
1. stop the server
2. cd /usr/local/mysql
3. mv data data1
4. cp -R data1 /dev/shm/data
5. ln -s /dev/shm/data /usr/local/mysql/data
6. start the server
Now the data is in memory, without any limitation.
(Warning: the data is in memory only! If your server shuts down, you lose all)
When you are finished, copy the data from the in-memory filesystem to the hard disk.
Cheers
Giuseppe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment