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

How to make your own native JavaScript router

Table of contents Preface Introduction JavaScript...

Analyze the usage and principles of Vue's provide and inject

First, let's talk about why we use provide/in...

In-depth explanation of the style feature in Vue3 single-file components

Table of contents style scoped style module State...

Detailed example of database operation object model in Spring jdbc

Detailed example of database operation object mod...

Weather icon animation effect implemented by CSS3

Achieve results Implementation Code html <div ...

Detailed explanation of mysql integrity constraints example

This article describes the MySQL integrity constr...

How to deploy kafka in docker

Table of contents 1. Build Docker 2. Enter the co...

A detailed discussion of MySQL deadlock and logs

Recently, several data anomalies have occurred in...

Detailed explanation of the use and precautions of crontab under Linux

Crontab is a command used to set up periodic exec...

Bundling non-JavaScript static resources details

Table of contents 1. Custom import in packaging t...

Detailed explanation of the steps to build a Vue project with Vue-cli

First you need to install Vue-cli: npm install -g...

Sample code for implementing history in vuex

I have recently been developing a visual operatio...

Detailed explanation of crontab scheduled execution command under Linux

In LINUX, periodic tasks are usually handled by t...