How to setup MySQL temp directory on RAM disk?

Posted: 0p in MySQL
Tags:

Create a tmpfs directory :

mkdir /var/tmpfs

chown mysql:mysql /var/tmpfs

id mysql

Make sure to get the uid and gid for mysql

vi /etc/fstab

tmpfs /var/tmpfs tmpfs rw,uid=498,gid=499,size=500M,nr_inodes=10k,mode=0700 0 0

Save and quit.

mount -a

vi /etc/my.cnf #or the mysql config file for your server

[mysqld]
tmpdir=/var/tmpfs
tmp_table_size=2K

Restart MySQL
——————————————————————->

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s