Perfectly solve the problem that mysql cannot start after phpstudy is installed

To learn php, of course, you must first install the operating environment. phpstudy is an integrated environment for running php. The one-click installation is very friendly to novices. As a novice, I followed the tutorial to install the phpstudy integrated environment.

It was installed soon, um. Really friendly to novices. phpmyadmin, Apache, php are directly configured and installed. Saved a lot of time.

But after the installation, I encountered a troublesome thing, that is, after a few seconds after Mysql starts, it will show that Mysql has stopped. Rebooted many times. Still can't start.

At this time, not only mysql in phpstudy cannot be started, but also my original mysql cannot be started.

(You can go directly to the problem-solving section at the end)

Cause Analysis

I went to the Internet to find the conflict between phpstudy and mysql. Oh, it turns out that both mysqls occupy port 3306, and the original mysql of the system will start up (this is where the original mysql will be used as a service to start monitoring). Then when you open phpstudy, a mysql service will be started again. At this time, because it is the same port, there will be a conflict.

 There are indeed people on the Internet who have encountered this problem like me. It is nothing more than deleting the original mysql or modifying the configuration file. Obviously, this solution is not what I want. And it didn't solve my problem successfully.

So I thought of trying to solve it like this. Changing the mysql port in phpstudy to 3307 will not conflict, I changed it, theoretically it can be successful, but it is still the same. The problem is not solved.

At this time, I want to uninstall mysql in phpstudy, but have you found the setting for setting the mysql path in phpstudy? This plan will not work, think of another plan.

So, I thought of moving the installed mysql to the mysql directory of phpstudy, and delete all the files in the original mysql location, so that phpstudy can use the original mysql database, so I tried again, or Didn't solve the problem. Because even if the mysql running file configuration file data file is moved in this way, the service in the computer management above is still starting the mysql service at the original location, and the mysql service file path specified by the mysql service cannot be modified. This plan will not work!

Solve the problem

Let's change our mind again. This time I restored all the deleted files in the original mysql directory, and now the original mysql and phpstudy mysql folders have the same content, as shown below:

Select Replace All when moving.

 

 To sum up, the solution is to copy all the files on the left side of the above picture directly to the right! ! !

Yay~~~Success~~~

Guess you like

Origin blog.csdn.net/m0_59673895/article/details/128229218