Re: Drive Critical: /dev/loop0 (/var/tmp) is 97% full - Linux, Unix, FreeBSD專區 - 頂客論壇 ,免費遊戲,免費交友,免費空間,免費部落格,免費相簿,免費開店 - 頂客社區 dk101.com 最用心的華人社群網站
發新話題

Re: Drive Critical: /dev/loop0 (/var/tmp) is 97% full

Re: Drive Critical: /dev/loop0 (/var/tmp) is 97% full

Re: Drive Critical: /dev/loop0 (/var/tmp) is 97% full
You can use the following steps to move the MySQL /tmp directory location:

1. Edit /etc/my.cnf file to set new tmpdir for MySQL

Code:
vi /etc/my.cnf
Place the following line into the file under the [mysqld] section:

Code:
tmpdir=/mysqltmp
Save the file with :wq

2. Create the /mysqltmp directory

Code:
mkdir /mysqltmp
chmod 1777 /mysqltmp
3. Restart MySQL and check that the tmpdir is now /mysqltmp

Code:
/etc/init.d/mysql restart
mysqladmin var | grep tmpdir
You should see the following return:

Code:
# mysqladmin var | grep tmpdir
| slave_load_tmpdir                       | /mysqltmp
| tmpdir                                  | /mysqltmp
This presumes / partition itself has sufficient space. I would like to hope / partition would have more space than /tmp was provided on most systems.

TOP

今天写了一个批处理脚本,将tmp目录扩展到2G
注:
sed -i -e 's/512000/2048000/g' /scripts/securetmp
注意脚本中的这句,这里面的2048000代表我们要扩展后的大小,单位是KB
tmp目录一般和内存同大小即可,不超过8GB大小,推荐2G,4G


代码 复制 - 运行

#!/bin/bash

# This script is FREE and written by 訪客無法瀏覽此圖片或連結,請先 註冊登入會員
/etc/init.d/chkservd stop
/etc/init.d/mysql stop
umount /var/tmp
umount /tmp
sed -i -e 's/512000/2048000/g' /scripts/securetmp
rm /usr/tmpDSK
/scripts/securetmp --auto
cd /tmp
ln -s /var/lib/mysql/mysql.sock
/etc/init.d/mysql start
/etc/init.d/chkservd start
df -lh
echo '';
echo '';
echo '';
echo "=======Technical support: QQ:200513538 ======= ";
echo '';
echo 'http://www.diledns.com';
echo '';
echo '';

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。