Skip to content

Instantly share code, notes, and snippets.

@up1
Created December 16, 2024 14:16
Show Gist options
  • Save up1/2a103a33b0478eda83a6ee3ed9690e78 to your computer and use it in GitHub Desktop.
Save up1/2a103a33b0478eda83a6ee3ed9690e78 to your computer and use it in GitHub Desktop.
Memcached from terminal
# สร้าง key ชื่อ user_01 มีค่าเป็น somkiat และ key มีอายุ 60 วินาที
$echo -e 'set user_01 0 60 5\r\nsomkiat\r' | nc <server ip> 11211
# ดึงข้อมูลด้วย key
$echo 'get user_01' | nc <server ip> 11211
# ลบข้อมูลด้วย key
$echo 'delete user_01' | nc <server ip> 11211
# ลบข้อมูลทั้งหมด
echo 'flush_all' | nc <server ip> 11211
# ดู stat ของ server
$echo 'stats' | nc <server ip> 11211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment