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:
- 32-bit system, version 1.2.5:http://static.jyshare.com/download/memcached-1.2.5-win32-bin.zip
- 32-bit system, version 1.2.6:http://static.jyshare.com/download/memcached-1.2.6-win32-bin.zip
- 32-bit system, version 1.4.4:http://static.jyshare.com/download/memcached-win32-1.4.4-14.zip
- 64-bit system, version 1.4.4:http://static.jyshare.com/download/memcached-win64-1.4.4-14.zip
- 32-bit system, version 1.4.5:http://static.jyshare.com/download/memcached-1.4.5-x86.zip
- 64-bit system, version 1.4.5: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, 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