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

View the frequently used SQL statements in MySQL (detailed explanation)

#mysql -uroot -p Enter password mysql> show fu...

How to use lodop print control in Vue to achieve browser compatible printing

Preface This control will have a watermark at the...

Using Nginx to implement grayscale release

Grayscale release refers to a release method that...

How to implement gzip compression in nginx to improve website speed

Table of contents Why use gzip compression? nginx...

Web componentd component internal event callback and pain point analysis

Table of contents Written in front What exactly i...

Detailed explanation of viewing and setting file permissions on Mac

Preface To modify file permissions in the termina...

Summary of the minesweeping project implemented in JS

This article shares the summary of the JS mineswe...

Vue project @change multiple parameters to pass multiple events

First, there is only one change event. changeleve...

Vue+axios sample code for uploading pictures and recognizing faces

Table of contents Axios Request Qs processing dat...

Comprehensive website assessment solution

<br />Sometimes you may be asked questions l...

Detailed tutorial on installing Docker and docker-compose suite on Windows

Table of contents Introduction Download and insta...

In-depth explanation of the locking mechanism in MySQL

Preface In order to ensure the consistency and in...

Detailed explanation of how components communicate in React

1. What is We can split the communication between...