MySQL 8.0.21 installation steps and problem solutions

MySQL 8.0.21 installation steps and problem solutions

Download the official website

First go to the official website to download MySQL

The link jumps to the download address of mysql: https://dev.mysql.com/downloads/mysql/
The latest version is 8.0.21

insert image description here
insert image description here

After decompression, it is as shown below.

insert image description here

Initial configuration

Since there is no my.ini file in the downloaded and unzipped folder, I created a new one here. I have given the configuration, and you can just copy it and modify it according to your actual situation.

insert image description here

[mysqld]
# Set port 3306 port=3306
# Set the installation directory of MySQL basedir=D:\Program Files (x86)\mysql-8.0.21-winx64\MySQL
# Set the storage directory of MySQL database data datadir=D:\Program Files (x86)\mysql-8.0.21-winx64\MySQL\Data
# Maximum number of connections allowed max_connections=200
# The number of connection failures allowed.
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
[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

About time zone settings

  • Refer to the author's time zone configuration
  • Add default-time_zone = '+8:00' to the mysqld section of the my.ini file

**BOLD STYLE**

About the problem of discontinuous id after deleting data

In order to output the id in sequence, we need to initialize the id and reset it
alter table user3 drop id;
alter table user3 add id int not null primary key auto_increment first;

Formal installation

Okay, the preparations are complete, let's start the installation.

insert image description here

Simply enter cmd in the address bar to enter the command line interface for installation.
Some of you may not have the permission to run the program, so you have to run it as an administrator.

insert image description here

insert image description here

I. . Crying, I actually believed it, but the same thing happened after reinstalling. Okay, I'll go download it.

insert image description here

Hiss, that’s too much!

insert image description here

The author cried and installed a VM virtual machine, regained his confidence, and restarted the computer

Configuration

mysqld --initialize --console

insert image description here

🆗!!!

insert image description here

This is a temporary password.

Execute the following command: mysqld --install to install

insert image description here

This is success

insert image description here

Start MySQL

The installation is successful, ready to start MySql:

net start mysql, this is to start the mysql service net stop mysql, this is to shut down the mysql service

insert image description here

By the way, regarding how to visually operate MySQL, I personally use this one

insert image description here
insert image description here

Do you still have the previous password saved?

insert image description here
insert image description here

Hiss, maybe it has been too long, I can actually set a password directly.

Of course, you can also connect to the database in the mysql\bin directory we just operated on:
mysql -u root -p
Enter the password and press Enter

insert image description here
insert image description here

When you see mysql> appear, you know you have entered the MySQL command line and can now change your password!
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password';

Press Enter and then **exit; **This will exit MySQL

About the system error 2 reported during the installation process

insert image description here

Even if we configure the system environment variables, there is still system error 2.
There is no need to panic at this time, just continue according to the author's instructions.
Note: first remove the service we installed incorrectly, or uninstall the remaining service

  • mysqld remove
  • mysqld install
  • net start mysql

Then it succeeded.

insert image description here
insert image description here

The service already exists!

If we display this sentence after mysqld --install: The service already exists!
Use sc delete mysql to delete the service.
Then run mysqld --isntall
It will show Service successfully installed.

This is the end of this article about the installation steps of MySQL 8.0.21 and solutions to problems. For more information about the installation steps of MySQL 8.0.21, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • MySQL 8.0.21 installation tutorial under Windows system (illustration and text)
  • MySQL Installer 8.0.21 installation tutorial with pictures and text
  • MySQL 8.0.21.0 Community Edition Installation Tutorial (Detailed Illustrations)
  • MySQL 8.0.21 installation and configuration method graphic tutorial

<<:  Analysis of the implementation process of Docker intranet penetration frp deployment

>>:  The HTML 5 draft did not become a formal standard

Recommend

A brief discussion on this.$store.state.xx.xx in Vue

Table of contents Vue this.$store.state.xx.xx Get...

Play and save WeChat public account recording files (convert amr files to mp3)

Table of contents Audio transcoding tools princip...

Use of environment variables in Docker and solutions to common problems

Preface Docker can configure environment variable...

Vue storage contains a solution for Boolean values

Vue stores storage with Boolean values I encounte...

Vue3.0+vite2 implements dynamic asynchronous component lazy loading

Table of contents Create a Vite project Creating ...

Install JDK1.8 in Linux environment

Table of contents 1. Installation Environment 2. ...

HTML validate HTML validation

HTML validate refers to HTML validation. It is the...

How to configure domestic sources in CentOS8 yum/dnf

CentOS 8 changed the software package installatio...

JavaScript dynamically generates a table with row deletion function

This article example shares the specific code of ...

The impact of limit on query performance in MySQL

I. Introduction First, let me explain the version...

Detailed deployment of Alibaba Cloud Server (graphic tutorial)

I have recently learned web development front-end...