How to install mysql8.0.23 under win10 and solve the problem of "the service does not respond to the control function"

How to install mysql8.0.23 under win10 and solve the problem of "the service does not respond to the control function"

Install mysql under win10

1. Download MySQL from the official website

Website: https://www.mysql.com/downloads/

mysq

Scroll down the download page: click the red box below:

insert image description here

Follow the instructions below:

insert image description here

insert image description here

After downloading, unzip it:

The decompressed directory is shown below:

insert image description here

2. Configure environment variables

This computer -> Properties -> Advanced system settings -> Environment variables -> path in user variables (double-click) -> Edit (add the bin directory under the mysql installation directory). The specific steps are as follows:
(I usually add both user variables and system variables)

insert image description here
insert image description here
insert image description here
insert image description here

3. Configure the initialization my.ini file (this file does not exist in the newly unzipped directory)

my.ini file:

insert image description here

The edited content is as follows:

[mysqld]
# Set port 3306 port=3306
#Set the installation directory of mysql basedir=E:\\tools\\mysql-8.0.23-winx64\\mysql-8.0.23-winx64 #Remember to use double slashes\\, single slashes will make mistakes here #Set the storage directory of mysql database datadir=E:\\tools\\mysql-8.0.23-winx64\\mysql-8.0.23-winx64\\data #The data directory will be automatically created after initialization #The maximum number of connections allowed max_connections=200
# The number of connection failures allowed. This is to prevent someone from trying to attack the database system from this host max_connect_errors = 10
# The default character set used by the server is UTF8
character-set-server=utf8mb4
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB
# By default, the "mysql_native_password" plug-in is used for authentication. default_authentication_plugin=mysql_native_password
[mysql]
# Set the default character set of the mysql client to default-character-set=utf8mb4
[client]
# Set the default port used by the mysql client to connect to the server port = 3306
default-character-set=utf8mb4

4. Install mysql

(1) Open cmd and run it with administrator privileges
(2) Initialize the database
Enter the bin directory of the MySQL installation directory in cmd and execute the command:

mysqld --initialize --console

After the execution is complete, the initial default password of the root user will be printed, for example:

insert image description here

The final: ?<M6fpM)i,/q is the initial password (excluding the first space). Before changing the password, you need to remember this password as it will be needed for subsequent logins.

(3) Installation service:
Execute the command in the bin directory of the MySQL installation directory:

mysqld --install [service name]

If you do not specify a service name, the default service name is mysql.
The successful execution is as follows:

insert image description here

After the installation is complete, you can start the MySQL service through the command net start mysql.

net start mysql

After success, the following will appear:

insert image description here

If unsuccessful, start the service if the following occurs:

insert image description here

Try the solution: Visit https://cn.dll-files.com/vcruntime140_1.dll.html and download the latest version of VCRUNTIME140_1.DLL.

insert image description here

After downloading, put the unzipped file directly into the bin subdirectory of MySQL. Re-run the command: net start mysql to succeed

insert image description here

(4) Stop the service using the command net stop mysql. Uninstall the MySQL service using the command sc delete MySQL or mysqld -remove

5. Change your password

In the bin directory, enter:

mysql -u root -p

You will be prompted to enter a password: fill in the initialization password to enter the MySQL command mode.

insert image description here

Execute the command in MySQL:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new password';

Change the password. Note that the ";" at the end of the command must be there. This is the syntax of MySQL and the new password must be enclosed in quotation marks.

At this point, the installation and deployment is complete.

This is the end of this article about installing mysql8.0.23 under win10 and the solution to the problem of "the service does not respond to control functions". For more relevant content about installing mysql8.0.23 under win10, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • MySQL 8.0.24 version installation and configuration method graphic tutorial
  • MySQL 8.0.24 installation and configuration method graphic tutorial
  • Some improvements in MySQL 8.0.24 Release Note
  • Detailed steps for Java to connect to MySQL 8.0 JDBC (IDEA version)
  • Detailed analysis of MySQL 8.0 memory consumption
  • Detailed graphic description of MySql8.023 installation process (first installation)
  • MySQL 8.0 New Features - Introduction to the Use of Management Port
  • MySQL 8.0 New Features - Introduction to Check Constraints
  • mysql8.0.23 msi installation super detailed tutorial
  • MySQL 8.0.23 free installation version configuration detailed tutorial
  • Basic operations on invisible columns in MySQL 8.0

<<:  A brief description of the relationship between k8s and Docker

>>:  Some questions about hyperlinks

Recommend

How to open a page in an iframe

Solution: Just set the link's target attribute...

A detailed introduction to deploying RabbitMQ environment with docker

Prerequisites: Docker is already installed 1. Fin...

Detailed explanation of DIV+CSS naming rules can help achieve SEO optimization

1. CSS file naming conventions Suggestion: Use le...

The benefits and examples of placing the site map at the bottom of the web page

In the past, almost every website had a sitemap p...

Implementation of mounting NFS shared directory in Docker container

Previously, https://www.jb51.net/article/205922.h...

Learn the black technology of union all usage in MySQL 5.7 in 5 minutes

Performance of union all in MySQL 5.6 Part 1:MySQ...

Introducing multiple custom fonts in CSS3

Today I found a problem in HTML. There are many d...

How to deploy MySQL master and slave in Docker

Download image Selecting a MySQL Image docker sea...

How to add configuration options to Discuz! Forum

Discuz! Forum has many configuration options in th...

Use docker to deploy tomcat and connect to skywalking

Table of contents 1. Overview 2. Use docker to de...

Simple example of using Docker container

Table of contents 1. Pull the image 2. Run the im...

How to ensure that every page of WeChat Mini Program is logged in

Table of contents status quo Solution Further sol...