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 required version number:

  • 32-bit system 1.2.5 version:http://static.jyshare.com/download/memcached-1.2.5-win32-bin.zip
  • 32-bit system 1.2.6 version:http://static.jyshare.com/download/memcached-1.2.6-win32-bin.zip
  • 32-bit system 1.4.4 version:http://static.jyshare.com/download/memcached-win32-1.4.4-14.zip
  • 64-bit system 1.4.4 version:http://static.jyshare.com/download/memcached-win64-1.4.4-14.zip
  • 32-bit system 1.4.5 version:http://static.jyshare.com/download/memcached-1.4.5-x86.zip
  • 64-bit system 1.4.5 version:http://static.jyshare.com/download/memcached-1.4.5-amd64.zip

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, we introduce two different installation methods for versions 1.4.4 and 1.4.5 below:


Installing memcached < 1.4.5

1. Extract 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 actual 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 memcached configuration items, you can execute the following in the command line:regedit.execommand to open the registry and find "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached" to modify.

If you want to set the cache configuration used by memcached, you can modifyImagePathto:

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

-m 512This 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

Installing memcached >= 1.4.5

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

2. After memcached version 1.4.5, memcached cannot be run as a service. You need to use Task Scheduler to start a normal process and set memcached to run automatically when Windows starts.

Run 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 actual path.

Note:-m 512This 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
Other extensions