วิธีแก้ปัญหา Can't create/write to file '/tmp/#sql_6182_0.MAI' (Errcode: 2)

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: วิธีแก้ปัญหา Can't create/write to file '/tmp/#sql_6182_0.MAI' (Errcode: 2)

วิธีแก้ปัญหา Can't create/write to file '/tmp/#sql_6182_0.MAI' (Errcode: 2)

โดย mindphp » 18/09/2017 3:40 pm

วิธีแก้ปัญหา Can't create/write to file '/tmp/#sql_6182_0.MAI' (Errcode: 2)
สาเหตุปัญหาเป็นเพราะ Folder /tmp บน Server ไม่สามารถเขียนได้จาก mysql
ใช้เช็คตามขั้นตอนดังนี้
1. ดูค่า Config .cnf ของ mysql บน Server

โค้ด: เลือกทั้งหมด

cat /etc/my.cnf | grep tmpdir

เช็คว่า tmpdir อยู่ที่ไหน ถ้ายังไม่มี เพิ่ม tmpdir=/tmp เข้าไปในไฟล์ my.cnf
2. เช็คว่า พื้นที่เหลือพอสำหรับการเขียน temp ไฟล์ไหม ถ้าไม่พอให้เคลียร์พื้นที่ให้พอ หรือ แก้ไขค่าในข้อ 1
3. Restart mysql

โค้ด: เลือกทั้งหมด

/etc/init.d/mysqld restart

ข้างบน