Table of contents
1. Problem description
Some people, especially school students, do not use MySQL very frequently, so there is a mysqld.exe program resident in their computers that still takes up a lot of memory, so they want to stop the program.
However, when I wanted to use it again, I found that the database could not be connected, and various errors were reported:
MySQL Workbench Error: Can't connect to MySQL server on 'localhost' (10061) The
"Start Server" in the software does not work at all.
Navicat for MySQL error: 2003 - Can’t connect to MySQL server on ‘localhost’(10038)
2. Preliminary solution to the problem
Later, you found the above problem on the Internet. In fact, you only need to enable the MySQL local service.
So you, skillfully press Win
+ R
, enter services.msc
Enter, find the MySQL80 service (different versions have different names), right click, , 启动
and solve the problem.
But, do you think this is the end?
Yes. It's over.
But you have come to the problem of mysqld.exe occupying memory...
3. Resolve the problem
The problem of memory usage is obvious. You can set the MySQL service startup type (that is, the startup type in the above picture) to
手动
, and then press the above operation every time you want to use MySQL.
However, I'm lazy, I don't want to have to operate like a tiger every time, and open the service like a dog.
So I made a script, every time I need to use the MySQL database, I just run it first, wouldn't it be beautiful?
Similarly, first set the MySQL service startup type to 手动
, so that the mysqld.exe program will not run by default when the computer is turned on.
Then, the script runs:
That's super easy, isn't it!
4. Resource download
MySQL80
Note that it will be changed to your MySQL service name after downloading
MySQL Service Manager.bat
MySQL Service Manager_en.bat
MySQL Service Manager_en_cn.bat
Personal experience, please correct me if there are deficiencies.
Original articles, please follow the rules for reprinting.