C:\Program Files\MySQL\MySQL Server 8.0\bin>net start mysql MySQL service is starting. MySQL service cannot be started. The service did not report any errors

This problem has troubled me for a day, and
finally solved today,
step by step

1. Search service

Insert picture description here
Find mysql, start it
Insert picture description here

2. The administrator opens cmd (must be the administrator or report an error)

Insert picture description here

3. Copy the mysql installation directory and the path of the bin folder

Insert picture description here

4.cd into the folder

cd C:\Program Files\MySQL\MySQL Server 8.0\bin

enter

mysqld -install

Insert picture description here
If successfully installed appears, the download is complete.

5. Create the initial configuration file my.ini in the installation directory

Insert picture description here

Insert picture description here
Enter the following

[mysqld]
basedir=C:\Program Files\MySQL\MySQL Server 8.0
datadir=C:\Program Files\MySQL\MySQL Server 8.0\data
port=3306

Note: The port number set here is 3306 by default. If 3306 is occupied, a port needs to be replaced.

6. Continue to enter the cmd command line in the bin directory

mysqld --initialize --console 

Enter, enter

net start mysql

Now the problem is here.
Insert picture description here
Note * If this can be initialized, delete all the things in the data folder in the same folder as bin.

7. Don't be afraid, follow me to check the port

netstat -aon|findstr "3306"

Insert picture description here
It is found that it is occupied in this process.
We open the task manager, find the location of pid, find
Insert picture description here
the process number above, and end it.

8. Connect again and enter the command

net start mysql

Insert picture description here
over, I wish you can solve this problem too!

Guess you like

Origin blog.csdn.net/qq_43511299/article/details/112346223