Perfect solution to mysql cannot start after phpstudy is installed (no need to delete the original database, no need to change any configuration, no need to change the port) direct coexistence

Perfect solution to mysql cannot start after phpstudy is installed (no need to delete the original database, no need to change any configuration, no need to change the port) direct coexistence

Today, when learning PHP, of course, you have to install the running environment first. Phpstyudy 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 quickly, yeah. It's really friendly to newbies. phpmyadmin, Apache, and php are directly configured and installed. Saves a lot of time.

However, after the installation, I encountered a troublesome problem. After starting MySQL, it would show that MySQL had stopped after a few seconds (this is what I have done now. I have solved this problem. It should be a red box. Don't mind it. /hehe). Restarted many times. Still can't start.

At this time, not only the mysql in phpstudy cannot be started, but my original mysql cannot be started either. What should I do? I still have a lot of data.

2. Cause Analysis

So I went online to look up the conflict between phpstudy and mysql. It turned out that both mysqls were occupying port 3306, and the original mysql of the system would start at boot (it would make the original mysql start listening as a service at boot). Then when you open phpstudy, another mysql service will be started. This time, because it is the same port, there will be a conflict.

There are indeed people on the Internet who have encountered the same problem as me. The only solution is to delete the original mysql or modify the configuration file. Obviously, this solution is not what I want.

3. Problem Solving

So I thought I'd try this solution. Will there be no conflict if I change the mysql port in phpstudy to 3307? I changed it and theoretically it worked, but it's still the same as before. Forget it, it’s too much trouble. Let’s try another approach!

At this time, I want to uninstall MySQL in phpstudy, but have I found the setting for setting the MySQL path in phpstudy? If this plan doesn't work, think of another one.

So, I thought of moving the installed mysql to the mysql directory of phpstudy and deleting all the files in the original mysql directory. Would this allow phpstudy to use the original mysql database? I tried it again, but still couldn'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 still starts the MySQL service in the original location, and the MySQL service file path specified by this MySQL service cannot be modified. This plan won’t work!

Let’s change our thinking. This time I restored all the files deleted from the original mysql directory. Now the original mysql and phpstudy's 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 →_→ on the right~~~

Finally, here is a successful screenshot, yeah~~~

At this time, the problem is perfectly solved. The original data can be retained and two MySQLs can coexist. There is no need to modify the configuration file. The problem can be solved by just pressing ctrl+c ctr+v.

Summarize

The above is the perfect solution that the editor introduced to you. After phpstudy is installed, MySQL cannot be started (no need to delete the original database, no need to change any configuration, no need to change the port). Direct coexistence, I hope it will be helpful to everyone. If you have any questions, please leave me a message, the editor will reply to you in time!

You may also be interested in:
  • MySQL 8.0 New Features - Introduction to Check Constraints
  • In-depth explanation of hidden fields, a new feature of MySQL 8.0
  • Implementation of check constraints in MySQL 8.0
  • Analysis of the new features of MySQL 8.0 - transactional data dictionary and atomic DDL
  • MySQL 8.0 New Features: Hash Join
  • A brief discussion on the pitfalls and solutions of the new features of MySQL 8.0 (summary)
  • MySQL 8.0 new features: support for atomic DDL statements
  • Detailed explanation of new relational database features in MySQL 8.0
  • Solution to IDEA not being able to connect to MySQL port number occupation
  • Use MySQL to open/modify port 3306 and open access permissions in Ubuntu/Linux environment
  • Enable remote access rights for MySQL under Linux and open port 3306 in the firewall
  • MySQL 8.0 New Features - Introduction to the Use of Management Port

<<:  How to install yum source and upload and download commands rz and sz under CentOS7 (with pictures)

>>:  React passes parameters in several ways

Recommend

MySql 8.0.11 installation and configuration tutorial

Official website address: https://dev.mysql.com/d...

Docker and portainer configuration methods under Linux

1. Install and use Docer CE This article takes Ce...

How to get the current time using time(NULL) function and localtime() in Linux

time(); function Function prototype: time_t time(...

Javascript scope and closure details

Table of contents 1. Scope 2. Scope Chain 3. Lexi...

How to implement Echats chart large screen adaptation

Table of contents describe accomplish The project...

JS asynchronous code unit testing magic Promise

Table of contents Preface Promise chaining MDN Er...

Limit input type (multiple methods)

1. Only Chinese characters can be input and pasted...

Summary of 10 must-see JavaScript interview questions (recommended)

1.This points to 1. Who calls whom? example: func...

A detailed analysis of the murder caused by a misplaced double quote in MySQL

1. Introduction Recently, I often encounter devel...

Three Vue slots to solve parent-child component communication

Table of contents Preface Environment Preparation...

Solution to large line spacing (5 pixels more in IE)

Copy code The code is as follows: li {width:300px...

Why the CSS attribute value clear:right does not work in detail

Using the clear property to clear floats is a comm...

Centos7 installation of Nginx integrated Lua sample code

Preface The computer I use is a Mac, and the oper...