MySQL 8.0.21 installation tutorial under Windows system (illustration and text)

MySQL 8.0.21 installation tutorial under Windows system (illustration and text)

Installation suggestion : Try not to use .exe for installation, but use compressed package for installation, which is more convenient for future uninstallation/version upgrade

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

1. Click the download address above to get the zip compressed package

2. Unzip to the directory to be installed

Here is E:\database\mysql8\mysql-8.0.21-winx64\bin

The data folder and my.ini file need to be created manually

3. Add environment variables

My Computer -> Properties -> Advanced System Settings -> Environment Variables

Select path to add: bin folder address under MySQL installation directory

Here you need to pay attention to whether you have installed an old version of MySQL before, and you need to remove its environment variables

img alt="" width="525" height="559" src="//img.jbzj.com/file_images/article/202008/2020081310113453.png" />

4. Add MySQL configuration file my.ini

In your MySQL installation directory, create a new my.ini file and edit   The my.ini file writes the Mysql related configuration (different configurations can be made according to the actual situation), and pay attention to replacing the installation path

[mysql]

# Set the default character encoding of the mysql client to default-character-set=utf8mb4

[mysqld]

#Set the port number, default is 3306

port = 3306

# Set the installation directory of mysql basedir=E:\database\mysql8\mysql-8.0.21-winx64\

# Set the data storage directory of mysql database datadir=E:\database\mysql8\mysql-8.0.21-winx64\data\

# Set the maximum number of connections max_connections=200

# The number of connection failures allowed is max_connect_errors=10

# The default character set used by the server is utf8mb4

character-set-server=utf8mb4

# The default storage engine that will be used when creating a new table default-storage-engine=INNODB

#Default authentication is done with the "mysql_native_password" plugin #mysql_native_password

default_authentication_plugin=mysql_native_password

[client]

# Set the default port used by the mysql client to connect to the server port = 3306

default-character-set=utf8mb4

E:\database\mysql8\mysql-8.0.21-winx64 needs to be changed to your own directory

5. Install MySQL service

Start cmd in administrator mode , switch the path to the bin directory under the MySQL installation directory , and enter the following command

cd \e E:\database\mysql8\mysql-8.0.21-winx64\bin

mysqld –install 

An error message appears after entering the command:

The following runtime libraries were installed successfully

Link: https://pan.baidu.com/s/1hrOiKNEegCsc0uAa5MFDgw

Extraction code: 36ma

After downloading and installing, continue to execute the installation service command:

The prompt service already exists, because the 5.7.26 version of mysql has been installed before and has not been uninstalled

At this time, open cmd again as an administrator and enter the command sc query mysql to view the service named mysql

Enter the command sc delete mysql to delete the old version of MySQL service

Execute the installation command again

6. Initialize data files

Enter the following command:mysqld --initialize-insecure --user=mysql

7. Start Mysql

net start mysql 

8. Change password

mysql -u root –p

When you enter the password, press Enter directly, and then you can enter the mysql management interface

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

As shown below: Change the password to root

9. Restart mysql and it will work normally

Here restart the cmd to run as an administrator

Exit the MySQL management interface

eixt

Stop mysql service

net stop mysql

Start mysql service

set start mysql 

Summarize

This is the end of this article about the installation tutorial of MySQL 8.0.21 under Windows system. For more relevant MySQL 8.0.21 installation content, 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:
  • How to install MySQL 8.0.28.0.msi on Windows (with pictures and text)
  • MySQL 8.0.25 installation and configuration tutorial under Windows 64 bit (most detailed!)
  • Detailed explanation of the problem of installing MYSQL5.7.24 under Windows Server 2012
  • Detailed installation process and basic usage of MySQL under Windows
  • Detailed introduction to the MySQL installation tutorial under Windows
  • Detailed tutorial for installing the unzipped version of mysql5.7.28 winx64 on windows
  • The latest version of MySQL 8.0.22 download and installation super detailed tutorial (Windows 64 bit)
  • MySQL 8.0.22 installation and configuration method graphic tutorial under Windows 10
  • MySQL 8.0.19 installation detailed tutorial (windows 64 bit)
  • MySQL 8.0.20 Installation Tutorial with Pictures and Text (Windows 64-bit)
  • MySQL 8.0.19 winx64 installation tutorial and change the initial password under Windows 10
  • Tutorial on installing MySQL 8.0.x on Windows

<<:  How to switch directories efficiently in Linux

>>:  Detailed explanation of Js class construction and inheritance cases

Recommend

Docker container time zone error issue

Table of contents background question Problem ana...

Use simple jQuery + CSS to create a custom a tag title tooltip

Introduction Use simple jQuery+CSS to create a cus...

Detailed steps to build the TypeScript environment and deploy it to VSCode

Table of contents TypeScript environment construc...

Detailed explanation of mixed inheritance in Vue

Table of contents The effect of mixed inheritance...

A Brief Analysis of MySQL - MVCC

Version Chain In InnoDB engine tables, there are ...

How to manually upgrade the node version under CentOs

1. Find the corresponding nodejs package, refer t...

Vue implements dynamic query rule generation component

1. Dynamic query rules The dynamic query rules ar...

JavaScript to implement simple carousel chart most complete code analysis (ES5)

This article shares the specific code for JavaScr...

How to use Navicat to export and import mysql database

MySql is a data source we use frequently. It is v...

The concept of MySQL tablespace fragmentation and solutions to related problems

Table of contents background What is tablespace f...

Share MySql8.0.19 installation pit record

The previous article introduced the installation ...

Sharing experience on the priority of CSS style loading

During the project development yesterday, I encoun...

Use Shell scripts to batch start and stop Docker services

Table of contents Start Docker Stop Docker Python...

Understanding the CSS transform-origin property

Preface I recently made a fireworks animation, wh...

Use of Linux ln command

1. Command Introduction The ln command is used to...