MySQL 8.0.22 decompression version installation tutorial (for beginners only)

MySQL 8.0.22 decompression version installation tutorial (for beginners only)

1. Resource download

Official website download address: https://dev.mysql.com/downloads/mysql/

insert image description here

insert image description here

2. Unzip the software

2.1 Choose a location

One thing to note is that the decompression path should avoid Chinese characters as much as possible, otherwise errors will be reported later.

2.2 Change the name (remove the file suffix)

insert image description here

If this modification is not made here, errors may be reported later! Personally tested.

3. Configuration File

3.1 Create my.ini file

insert image description here

Change the text suffix to ini and save it in ANSI format.

insert image description here

If this is not modified, it may cause error 2 in 4.2.2. Test it yourself! ;

3.2 Change the content of my.ini file

Open my.ini with the code writer on your computer and paste the code.

[mysqld]
# Set port 3306 port=3306
# Set the installation directory of MySQL. It must be consistent with the installation path above basedir=F:\\MySQL\\mysql
# Set the storage directory for the MySQL database data. It is automatically generated and does not need to be created manually. Of course, it can also be placed elsewhere datadir=F:\\MySQL\\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. It is not recommended to modify it. This is the recognized port number port=3306
default-character-set=utf8mb4

3.3 Modify the configuration file sql directory

Replace the following two paths with the path where you unzipped MySQL on your computer: \MySQL\mysql. However, please note that the \data after datadir cannot be modified, and it is "\" instead of \ here. This is something you need to pay attention to.

# Set the installation directory of MySQL. It must be consistent with the installation path above basedir=F:\\MySQL\\mysql
# Set the storage directory for the MySQL database data. It is automatically generated and does not need to be created manually. Of course, it can also be placed elsewhere datadir=F:\\MySQL\\mysql\\data //Don't forget data

4. Initialize the database

4.1 Right click and run cmd as an administrator to switch to the bin directory under mysql

The directory shown here is my directory. If you put it on another disk, you need to enter it first.

D:

Then press Enter, copy the path, and copy (right click) the space after cd

cd F:\MySQL\mysql\bin 

insert image description here

4.2 Executing Code

mysqld --initialize

You might be making a mistake here

4.2.1 Error 1

insert image description here

Or it is reported that VCruntime140_1.dll is missing
PS: I found this picture on the Internet and didn’t take a screenshot at the time.

Solution 1

If you encounter this error, go to the Microsoft official website: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads and select your system bit number to download.
Nowadays, computers generally choose X64 for downloading.

insert image description here

After downloading, install it. The error message will disappear.

4.2.2 Error 2 However, it is possible that after executing the code, the following error code is reported:

insert image description here

Solution 2

The solution is also simple:
Open the my.ini file with Notepad, then click Save As in the upper left corner, and select ANSI format for encoding.

insert image description here

After execution, the cursor will appear on the next line. And you will find that there is an additional data folder in your mysql folder. Then you can proceed to the next step.

insert image description here

insert image description here

5. Register Windows service

If cmd is still in the mysql-bin directory, enter the following code in the code line

mysqld --install MySQL

Successful execution sign

insert image description here

6. Start the mysql service

Enter the following code in the code line

net start MySQL

Successful execution sign

insert image description here

7. Log in to MySQL

7.1 Find the temporary password

Find the sk-pc.err file in the folder that was automatically generated just now (the file name sk-pc here is the computer name in the My Computer properties) and open it with the compiler

insert image description here

Find **A temporary password is generated for root@localhost:** The string of numbers after it is the temporary password. This is my temporary password: WSmnJ:bqz12g

insert image description here

7.2 Official Login

Execute the following code in your mysql-bin path, that is, execute 4.1 first, and then execute the following code

mysql -u root -p

Then the following will appear

insert image description here

Just copy and paste the password you just entered.

insert image description here

Login successful! ! !

8. Change password

First, the code

alter user'root'@'localhost' identified by 'new password'; 
alter user'root'@'localhost' identified with mysql_native_password by 'new password';

It should be noted here that after MySQL 8.0, only the above two commands can be used to change the password. Using other command line methods will result in an error. Newbies need to pay attention to the need for a semicolon at the end and not forget it.

insert image description here

I've changed to 111111 successfully!

exit

Exit with exit and the installation is complete!

This is the end of this article about the installation tutorial of the unzipped version of MySQL 8.0.22 (for novices only). For more information about the installation of the unzipped version of MySQL 8.0.22, 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:
  • Complete step-by-step record of MySQL 8.0.26 installation and uninstallation
  • Deepin20.1 system installs MySQL8.0.23 (super detailed MySQL8 installation tutorial)
  • mysql8.0.23 linux (centos7) installation complete and detailed tutorial
  • MySQL 8.0.23 installation super detailed tutorial
  • MySQL 8.0.26 installation and simplified tutorial (the most complete on the Internet)

<<:  The docker container directly runs to obtain the public IP operation through ping

>>:  HTML Tutorial: Definition List

Recommend

Some functions of using tcpdump to capture packets in the Linux command line

tcpdump is a flexible and powerful packet capture...

HTML5+CSS3 header creation example and update

Last time, we came up with two header layouts, on...

How to convert rows to columns in MySQL

MySQL row to column operation The so-called row-t...

How to import Chinese data into csv in Navicat for SQLite

This article shares with you the specific method ...

JavaScript imitates Jingdong magnifying glass special effects

This article shares the specific code of JavaScri...

CSS3 mobile vw+rem method to achieve responsive layout without relying on JS

1. Introduction (1) Introduction to vw/vh Before ...

Introduction to HTML_PowerNode Java Academy

What is HTML? HTML is a language used to describe...

Examples of importing and exporting MySQL table data

This article describes the import and export oper...

Vue3 manual encapsulation pop-up box component message method

This article shares the specific code of Vue3 man...

HTML Web Page List Tags Learning Tutorial

HTML web page list tag learning tutorial. In HTML ...

js learning notes: class, super and extends keywords

Table of contents Preface 1. Create objects befor...

Causes and solutions for MySQL deadlock

The database, like the operating system, is a sha...

Solutions for high traffic websites

First: First, confirm whether the server hardware ...

MySql fuzzy query json keyword retrieval solution example

Table of contents Preface Option 1: Option 2: Opt...

VSCode+CMake+Clang+GCC environment construction tutorial under win10

I plan to use C/C++ to implement basic data struc...