1. Create the tmp directory:
1 |
mkdir /var/lib/mysqltmp |
2. Set permissions:
1 |
chown mysql:mysql /var/lib/mysqltmp |
3. Determine mysql user id:
1 |
id mysql |
4. Edit /etc/fstab and add the following line:
1 |
tmpfs /var/lib/mysqltmp tmpfs rw,gid=27,uid=27,size=256M,nr_inodes=10k,mode=0700 0 0 |
5. Mount the new tmpfs partition:
1 |
mount /var/lib/mysqltmp |
6. Edit /etc/my.cnf and set location of tmp directory:
1 |
tmpdir=/var/lib/mysqltmp |
7. Restart mysqd
1 |
/sbin/service mysqld restart |