Installing Memcached on Windows
The official website does not provide a Windows platform installation package for Memcached. You can use the following links to download it. You need to click the corresponding link based on your system platform and the required version number:
32-bit system 1.2.5 version: http://static.tutorialpro.org/download/memcached-1.2.5-win32-bin.zip
32-bit system 1.2.6 version: http://static.tutorialpro.org/download/memcached-1.2.6-win32-bin.zip
32-bit system 1.4.4 version: http://static.tutorialpro.org/download/memcached-win32-1.4.4-14.zip
64-bit system 1.4.4 version: http://static.tutorialpro.org/download/memcached-win64-1.4.4-14.zip
32-bit system 1.4.5 version: http://static.tutorialpro.org/download/memcached-1.4.5-x86.zip
64-bit system 1.4.5 version: http://static.tutorialpro.org/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 will introduce the different installation methods for versions 1.4.4 and 1.4.5:
Installing Memcached <1.4.5 Version
Extract the downloaded installation package to a specified directory.
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.
Then you can use the following commands to start and stop the Memcached service:
c:\memcached\memcached.exe -d start c:\memcached\memcached.exe -d stop
To modify the configuration of Memcached, you can open the Registry Editor by running regedit.exe and navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached" to make changes.
To provide cache configuration for Memcached, modify ImagePath to:
"c:\memcached\memcached.exe" -d runservice -m 512
-m 512 means setting the maximum cache configuration for Memcached to 512M.
Additionally, you can view more parameter configurations using the command "c:\memcached\memcached.exe -h".
- If you need to uninstall Memcached, use the following command:
c:\memcached\memcached.exe -d uninstall
Installing Memcached >= 1.4.5 Version
Extract the downloaded installation package to a specified directory.
After version 1.4.5, Memcached cannot run as a service and needs to be started as a regular process using Task Scheduler to run automatically at Windows startup.
Run the following command with administrator privileges 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 512 means setting the maximum cache configuration for Memcached to 512M.
Note: You can view more parameter configurations using the command "c:\memcached\memcached.exe -h".
- To remove the Memcached task from the Task Scheduler, use the following command:
schtasks /delete /tn memcached