Sometimes it is thought that the server runs too long and MySQL cannot be released in the program, resulting in excessive pressure on the server. Therefore, let's imagine that Apache and MySQL memory will be released without restarting the server.
First, restart Apache.
Procedure:
Start> program> accessories> Management Tools> Task Plan
Add a task plan> next> Apache restart> select a time (I set it to every morning)> click OK.
MySQL restarts.
I used MySQL 4.0.17 and did not find the MySQL restart execution file. Therefore, I made one myself.
The following code is used:
@ Echo off
Net stop MySQL
Net start MySQL
Copy the above file, save it to notepad, and rename it C: mysql_restart.bat.
Continue the operations of the preceding Task Plan
Add a task scheduler> next> browse> mysql_restart.bat> set the time.
Of course, another method I found on the Internet is to save the following content as C: restart. bat
The following code is used:
@ Echo off
Net stop apache2
Net start apache2
Net stop MySQL
Net start MySQL
Run cmd to execute the command "at C: restart. Bat"