You will need to install Telnet first
Connect to Memcached via Telnet
The Telnet client is disabled by default on Windows, you need to enable it first:
Control Panel → Programs → Turn Windows features on or off → Check【Telnet Client】
Connection command:
telnet 127.0.0.1 11211Code language: CSS (css)
Five Essential Commands
General command format:
command key flags exptime bytes
Enter your payload after pressing enter
| Command | Purpose | Execution Result Description |
|---|---|---|
set | Set cache item, overwrite existing key, create new one if not exists | Returns STORED on success |
add | Add new cache entry, do nothing if key already exists | NOT_STORED returned when key exists |
replace | Update only existing key, no effect for non‑existent key | NOT_STORED returned when key missing |
get | Read cached value by key | Return value / END(no data found) |
delete | Remove cache for specified key | Append target key: delete site |
Practical Example
set site 0 0 7
foxdevelop.com
STORED
get site
VALUE site 0 7
foxdevelop.com
END
# Attempt add on existing key, will fail
add site 0 0 7
foxdevelop.com
NOT_STORED
# Replace to update value
replace site 0 0 7
foxdevelop.com2
STORED
# Delete entry
delete site
Code language: CSS (css)
Usage within command‑line terminal
Previous: Introduction and installation
Next: C# Usage