This post describes steps required to tranfer MySQL database files to RAM by using ramdisk on Linux. If you ever had to work with symfony and frequently rebuilding database schema, this could come in handy…
In this example I’m using Ubuntu 10 64bit LTS distribution.
First, mount a directory in ramdisk:

$ mount -t tmpfs -o size=400M tmpfs /tmp/ramdisk/

This should create a 400 MB ramdisk in your /tmp/ramdisk directory.
Then move MySQL database files to newly created ramdisk. In my configuration, MySQL files are located in /var/lib/mysql.

$ mv /var/lib/mysql /tmp/ramdisk/mysql

Then link back directory in ramdisk to original mysql files location by symbolic link:

$ ln -s /tmp/ramdisk/mysql /var/lib/mysql

If you were copying files as a root, you may have inadvertently changed file’s permissions. All files should be readable by mysql user, so make sure that they have the right owner:

chown mysql:mysql mysql

In case your MySQL service no longer recognizes database files (shows empty database), try to restart mysql service (you have to be sudo or root):

$ sudo /etc/init.d/mysql restart

… and that should be it. Your MySQL database is now running on your RAM, and you should notice considerable improvement in performance.
Note that you should probably back up your mysql database files, as they will dissapear from ramdisk when you shutdown or reboot your computer.