Some users may start or stop the MySQL service frequently when using the database. Sometimes, the MySQL service is being started or stopped. Please try again later. Such a prompt is shown in the figure below.



So I tried to solve this problem, but found that even forced database initialization is useless, and in the task manager process can not find mysqld related process, can not forcibly end the process. Even though MySQL is a service in the list of computer services, there is no button to stop or start it. It seems to “disappear from the earth” and no longer exists.



However, do not panic, xiaobian in the experience of many failed attempts, finally ushered in the success of the pit process is no longer described, will be sorted out smooth operation to share with you, so as not to take detdetments, the specific tutorial is as follows.

Open the cli as an administrator. Otherwise, you have no permission to access the cli. Then type the command “tasklist | findstr searches” mysql “, used to find the mysql process of residue. As a result, there are some residual mysql processes. No wonder the mysql service is being started or stopped. In this case, you need to kill mysql processes. Then type the command “taskkill/f/t/im mysqld. Exe”, all mysql residue processes can be killed, type the command again “tasklist | findstr searches” mysql “, see whether still have other mysql process, if there is, Continue killing until the process is completely killed, as shown in the following figure.



When all the remaining mysql processes are finished, we can start mysql services normally, as shown in the following figure. Note that you still need to enter the command line window as an administrator.



From the figure above, we can see that the database is now accessible. If you are not sure, you can continue testing by stopping the MySQL service and then trying to start and access it again, as shown in the figure below.



You can see that MySQL can now start and stop services normally.





Finally give you a little reminder, if the local database file copy directly to the database, before copy must guarantee the MySQL database is in a state of stop service, after the file copy, and then try to start the MySQL service, which can smoothly in the database access copied the database file, It is much faster than importing data directly into the database, especially importing hundreds of millions of pieces of big data. Using this method can get twice the result with half the effort.