Perfect solution: MySQL cannot start after phpstudy installation (no need to delete the original database, no need to change any configuration, no need to change the port) and coexist directly

Time:2019-12-4

To learn PHP today, of course, you need to install the running environment first. Phpstudy is an integrated environment for running PHP. One click installation is very friendly to novices. As a novice, he followed the tutorial to install the phpstudy integrated environment.

It’ll be installed soon, huh. It’s really friendly to novices. PhpMyAdmin, Apache and PHP are installed directly. It saves a lot of time.

However, there is a problem after the installation. After the MySQL is started, it will show that MySQL has stopped in a few seconds (this is the problem I have solved now, it should be a red box, don’t mind, / hehe). It was restarted many times. Still can’t start.

At this time, not only MySQL in phpstudy cannot be started, but also my original mysql. What can I do? I have a lot of data.

II. Cause analysis

So I went to the Internet to find the problem of the conflict between phpstudy and mysql. Oh, it turns out that both MySQL occupy port 3306, and the original MySQL of the system will start (here, the original MySQL will be used as a service to start and start monitoring). Then when you open phpstudy, you will start another MySQL service. Because it is the same port, it will conflict.

Some people on the Internet do encounter this problem like me. It’s nothing more than deleting the original MySQL or modifying the configuration file. Obviously, this solution is not what I want.

III. problem solving

So I want to try this solution. It doesn’t conflict if the MySQL port in phpstudy is changed to 3307. I changed it. In theory, it can succeed, but it’s still the same. Forget it. It’s too much trouble. Another way!

At this time, I want to uninstall MySQL in phpstudy, but have you found the setting of 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 deleting all the files in the original MySQL location, so that phpstudy could use the original MySQL database, so I tried again, but still failed to solve the problem. Because even if the MySQL run file configuration file data file is moved like this, the service in the above computer management is still starting the original MySQL service, and the MySQL service file path specified by the MySQL service cannot be modified. This plan will not work!

Let’s change our mind. This time, I will restore all the files deleted from the original MySQL directory. The original MySQL and phpstudy’s MySQL folders have the same contents, as shown in the following figure:

Select replace all on move.

To sum up, the solution is to copy all the files on the left of the above figure directly to the right~~~

Finally, another successful screenshot, yeah~~~

At this time, the problem will be solved perfectly. It can not only keep the original data and realize the coexistence of two mysql, but also operate without modifying the configuration file. As long as Ctrl + C CTR + V solves the problem.

summary

The above is the perfect solution that Xiaobian introduced to you. After phpstudy was installed, MySQL could not start (no need to delete the original database, no need to change any configuration, no need to change the port) and coexisted directly. I hope it can help you. If you have any questions, please leave a message to me, and Xiaobian will reply to you in time!

Recommended Today

JQuery source code series (VII) callbacks function

WelcomeMy columnView a series of articles. To be honest, the source code of sizzle is so depressing that it was very painful during the period of writing sizzle articles. At first, I thought it was very interesting. The later I felt that the code was difficult to read and annoying. After the winter vacation, I […]