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

Teach you how to build a react+antd project from scratch

The previous articles were all my own learning lo...

Detailed explanation of MySQL 30 military rules

1. Basic Specifications (1) InnoDB storage engine...

Vue2.x responsiveness simple explanation and examples

1. Review Vue responsive usage​ Vue responsivenes...

Detailed explanation of Linux text processing command sort

sort Sort the contents of a text file Usage: sort...

Detailed tutorial on using cmake to compile and install mysql under linux

1. Install cmake 1. Unzip the cmake compressed pa...

Using jQuery to implement the carousel effect

This article shares the specific code for impleme...

Why does MySQL paging become slower and slower when using limit?

Table of contents 1. Test experiment 2. Performan...

IE6 web page creation reference IE6 default style

This is not actually an official document of IE. I...

Nginx cache files and dynamic files automatic balancing configuration script

nginx Nginx (engine x) is a high-performance HTTP...

Problems installing TensorRT in docker container

Uninstall the installed version on Ubuntu: sudo a...

In-depth analysis of the Identifier Case Sensitivity problem in MySQL

In MySQL, you may encounter the problem of case s...

CSS web page responsive layout to automatically adapt to PC/Pad/Phone devices

Preface There are many devices nowadays, includin...