Detailed tutorial on downloading, installing and configuring the latest version of MySQL 8.0.21

Detailed tutorial on downloading, installing and configuring the latest version of MySQL 8.0.21

1. Download

1. Download the installation package

MySQL download path: https://dev.mysql.com/downloads/file/?id=496745

insert image description here

2. Unzip the compressed package

Unzip to the installation directory:

insert image description here

3. Create a new my.ini configuration file in this directory

[mysqld] 
# Set port 3306 port=3306 
# Set the installation directory of mysql basedir=D:\environment\mysql\mysql-8.0.21-winx64
# Set the storage directory of mysql database data datadir=D:\environment\mysql\mysql-8.0.21-winx64\data 
# 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=utf8 
# 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=utf8 
[client] 
# Set the default port used by the mysql client to connect to the server. port=3306 
default-character-set=utf8

Please note that you need to replace basedir and datadir with your own directories.

4. Configure environment variables

This computer->Properties->Advanced system settings->Environment variables->System variables->Path

The bin folder address under the mysql installation directory

insert image description here

5. Create data folder and initialize

Window+R Enter cmd and execute: mysqld --initialize-insecure

insert image description here

The first pitfall: VC++2015 (Microsoft Visual C++ 2015 Redistributable) was not installed. Download vc_redist.x64 and run the program, then install it directly.

The second pitfall:

insert image description here

Since the computer lacks this file, just download it and drop it under C:\Windows\System32.

insert image description here

At this time, execute the command: mysqld --initialize-insecure

There will be an additional data folder in the installation directory

6. Execute initialization statements

mysqld --defaults-file=D:\environment\mysql\mysql-8.0.21-winx64\my.ini --initialize –console

7. Install MySQL

mysqld install

Report another error:

insert image description here

Solution: Select "Open as administrator" when opening the cmd.exe program.

Here is a little extra knowledge: How to run cmd.exe as an administrator in Windows; open drive C->Windows->System32->find cmd.exe, right-click and run as administrator.

Then execute mysqld install, and it will display

insert image description here

8. Initialize MySQL and create the root user after execution

mysqld --initialize-insecure --user=mysql

9. Start MySQL service

net start mysql 

insert image description here

10. Set the root account and password

mysqladmin -u root -p password 123456

After startup, your root user password is empty. Press Enter and “Enter password” will appear. Do not enter any information. Press Enter for the next step. The password is 123456. Do not fill in enter password.

Login User

mysql -u root -p
(After pressing Enter, enter the password. The previously set password is 123456) 

insert image description here

At this point, the login is successful and the installation is complete.

Summarize

This is the end of this article about the download, installation and configuration tutorial of the latest version of MySQL 8.0.21. For more relevant MySQL 8.0.21 download, installation and configuration 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:
  • MySQL Installer 8.0.21 installation tutorial with pictures and text
  • Detailed tutorial for downloading and installing mysql8.0.21
  • MySQL 8.0.21.0 Community Edition Installation Tutorial (Detailed Illustrations)
  • MySQL 8.0.21 free installation version configuration method graphic tutorial
  • MySQL 8.0.21 installation and configuration method graphic tutorial
  • MySQL 8.0.21 installation tutorial under Windows system (illustration and text)

<<:  Vue.js implements tab switching and color change operation explanation

>>:  Detailed explanation of Nginx configuration file

Recommend

HTML uses form tags to implement the registration page example code

Case Description: - Use tables to achieve page ef...

Detailed explanation of Vue options

Table of contents 1. What are options? 2. What at...

CSS implements Google Material Design text input box style (recommended)

Hello everyone, today I want to share with you ho...

Implementation of MySQL scheduled database backup (full database backup)

Table of contents 1. MySQL data backup 1.1, mysql...

SQL implementation of LeetCode (183. Customers who have never placed an order)

[LeetCode] 183.Customers Who Never Order Suppose ...

MySQL Innodb key features insert buffer

Table of contents What is insert buffer? What are...

Introduction to using data URI scheme to embed images in web pages

The data URI scheme allows us to include data in a...

Use a few interview questions to look at the JavaScript execution mechanism

Table of contents Previous words Synchronous and ...

JS gets the position of the nth occurrence of a specified string in a string

Learn about similar methods for getting character...

jQuery to achieve sliding stairs effect

This article shares the specific code of jQuery t...

Detailed explanation of the process of using docker to build minio and java sdk

Table of contents 1minio is simple 2 Docker build...

Practical method of deleting associated tables in MySQL

In the MySQL database, after tables are associate...

MySQL NULL data conversion method (must read)

When using MySQL to query the database and execut...

Let’s take a look at JavaScript precompilation (summary)

JS running trilogy js running code is divided int...

Solve the problem of margin merging

1. Merge the margins of sibling elements The effe...