Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Installing Memcached on Windows

Installing Memcached on Windows

The official website does not provide a Windows platform installation package for Memcached; we can use the following links to download. You need to click the corresponding link to download according to your system platform and the version number you need:

Before version 1.4.5, memcached could be installed as a service, but this feature was removed in version 1.4.5 and later. Therefore, below we introduce the different installation methods for the two versions 1.4.4 and 1.4.5:


memcached <1.4.5 version installation

1. Unzip the downloaded installation package to a specified directory.

2. Before version 1.4.5, memcached could be installed as a service; run the following command with administrator privileges:



c:\memcached\memcached.exe -d install

**Note:** you need to replace c:\memcached\memcached.exe with the real path.

3. Then we can use the following commands to start and stop the memcached service:



c:\memcached\memcached.exe -d start

c:\memcached\memcached.exe -d stop

4. If you want to modify the memcached configuration items, you can execute regedit.exe in the command line to open the registry and find "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached" to modify them.

To provide the cache configuration used by memcached, you can modify ImagePath to:

"c:\memcached\memcached.exe" -d runservice -m 512

-m 512 which means setting the maximum cache configuration of memcached to 512M.

In addition, we can also use "c:\memcached\memcached.exe -h" command to view more parameter configurations.

5. If we need to uninstall memcached, we can use the following command:



c:\memcached\memcached.exe -d uninstall


memcached >= 1.4.5 version installation

1. Unzip the downloaded installation package to a specified directory.

2. After memcached 1.4.5, memcached cannot run as a service; you need to use Task Scheduler to start a normal process and set memcached to run automatically at Windows startup.

We execute the following command as administrator to add memcached to the Task Scheduler:



schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"

**Note:** you need to replace c:\memcached\memcached.exe with the real path.

Note: ****-m 512 which means setting the maximum cache configuration of memcached to 512M.

**Note:** we can use "c:\memcached\memcached.exe -h" command to view more parameter configurations.

3. If you need to delete the memcached scheduled task, you can execute the following command:



schtasks /delete /tn memcached