MySQL 5.7 installation MySQL service cannot be started but the service does not report any errors

MySQL 5.7 installation MySQL service cannot be started but the service does not report any errors

There are two ways to install MySQL 5.7. One is to download the installer and click to install. The other is to download the compressed package, unzip it directly, configure it and run it.

I personally prefer the compressed package format, so this article also records the installation (configuration) in the compressed package format.

https://dev.mysql.com/downloads/mysql/

The latest one I downloaded is mysql-5.7.17-win32.zip

Compress to the mysql-5.7.17-win32 folder. The files and folders mentioned later are all updated in this directory.

Configure the bin directory behind the environment variable path

Mine is ;D:\mysql-5.7.17-win32\bin

Copy the my-default.ini file and rename it to my.ini

The default file is all commented out, so don't worry about it.

Add the following parameters directly at the end

[mysqld]
port=3306
basedir=D:\mysql-5.7.17-win32
datadir=D:\mysql-5.7.17-win32\data
skip-grant-tables

Note that the red path is changed to your own directory

The skip-grant-tables configuration item is very important. It is used to skip the login verification.

Because you just installed it, you don't know what account to use to log in to MySQL. People who have used MySQL before may know the root account, but it is not possible to log in with root at this time.

Then open cmd

implement

mysqld install MySQL --defaults-file="D:\mysql-5.7.17-win32\my.ini" //You can use mysqld remove to delete. You need to reinstall every time you modify my.ini

After success, you can start mysql

implement

net start mysql //The shutdown command is net stop mysql

This will report

The MySQL service cannot be started. The service did not report any errors.

You have to execute

mysqld --initialize-insecure

This command will create a data folder in the mysql root directory

Then execute

net start mysql

This time it worked

implement

mysql -u root -p Enter

No need to enter the password, just press Enter

Successfully logged into mysql

Then

use mysql //Enter the mysql database

Set root password

update user set authentication_string = password('root'), password_expired = 'N', password_last_changed = now() where user = 'root';

Note that authentication_string was password before 5.7

If you need a remote client connection, you can execute

Grant all on *.* to 'root'@'%' identified by 'root' with grant option;

In this way, you can connect to this mysql remotely, otherwise you can only connect locally

The above is what the editor introduced to you about MySQL 5.7 installation. The MySQL service cannot be started, but the service does not report any errors. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Detailed steps to install Anaconda on Linux (Ubuntu 18.04)
  • Install MySQL 5.7 on Ubuntu 18.04
  • How to install KVM virtual machine on Ubuntu 18.04 LTS
  • Ubuntu 18.04 MySQL 8.0 installation and configuration method graphic tutorial
  • Solve Scrapy installation error: Microsoft Visual C++ 14.0 is required...
  • Solve the error of installing VMware Tools on Ubuntu 18.04

<<:  Detailed explanation of KVM deployment of three virtual machines to implement WordPress experiment

>>:  A complete tutorial on using axios encapsulation in vue

Recommend

Mysql Workbench query mysql database method

Mysql Workbench is an open source database client...

Vue Element front-end application development to obtain back-end data

Table of contents Overview 1. Acquisition and pro...

Detailed process of configuring Https certificate under Nginx

1. The difference between Http and Https HTTP: It...

Analysis of Docker's method for creating local images

The so-called container actually creates a readab...

How to use @media in mobile adaptive styles

General mobile phone style: @media all and (orien...

Pure CSS and Flutter realize breathing light effect respectively (example code)

Last time, a very studious fan asked if it was po...

Mysql some complex sql statements (query and delete duplicate rows)

1. Find duplicate rows SELECT * FROM blog_user_re...

W3C Tutorial (13): W3C WSDL Activities

Web Services are concerned with application-to-ap...

Practice of Vue global custom instruction Modal drag

Table of contents background Implementation ideas...

Enable sshd operation in docker

First, install openssh-server in docker. After th...

Detailed installation tutorial of Docker under CentOS

Docker is divided into CE and EE. The CE version ...

Nginx stream configuration proxy (Nginx TCP/UDP load balancing)

Prelude We all know that nginx is an excellent re...

MySQL data insertion efficiency comparison

When inserting data, I found that I had never con...