root@myserver:~# dd if=/dev/zero of=/swap.dat bs=1024 count=512k
root@myserver:~# mkswap /swap.dat
root@myserver:~# swapon /swap.dat
root@myserver:~# vim /etc/fstab
vim is started to edit, add the following to the end of /etc/fstab file
/swap.dat none swap sw 0 0
Then, edit the mysql config file
root@myserver:~# vim /etc/mysql/my.cnf
And add this under [mysqld]
innodb_buffer_pool_size=64M
Finally reload mysql
root@myserver:~# service mysqld reload