MySQL installation (detailed tutorial)


foreword

The main purpose of this article is to install MySQL on Windows. The following content is compiled from Bilibili - MySQL database entry to proficiency .

If you want to install MySQL under Linux, see Linux-Installing MySQL (Detailed Tutorial)

I do not produce knowledge, I am just a porter of knowledge~~


I. Overview

MySQL is a relational database management system, and the SQL language used is the most commonly used standardized language for accessing databases. MySQL software adopts a dual authorization policy, which is divided into community edition and commercial edition. Because of its small size, fast speed, low overall cost of ownership, especially the open source feature, MySQL is generally chosen as the website for the development of small, medium and large websites. database.

  • Community Edition: Free, but does not provide any technical support
  • Commercial version: charge, you can try it for 30 days, and the official technical support is provided

Two, download

Official website: https://www.mysql.com/

insert image description here

After entering the official website, clickDOWNLOADS

insert image description here

enter the page
insert image description here

We can directly download the community version of MySQL here, clickMySQL Community (GPL) Downloads >>

insert image description here

Here you can see that the official provides many forms of downloads,

Click MySQL Intaller for Windowsto enter the following page and then Downloadclick to download the installation package.
insert image description here

----------------------------------------------------

It may be slower to download directly here. I provide the downloaded installation package below:

URL: Baidu Netdisk

Extraction code: s5lu

----------------------------------------------------

3. Installation

(1) Installation

Installing MySQL under windows is basically a fool's installation

Double-click the downloaded installation package

insert image description here

clicknext

insert image description here

clicknext

insert image description here

chooseYes

insert image description here

Click Excuteto install the related components of MySQL, this process may take a few minutes

insert image description here

clicknext

insert image description here

clicknext

insert image description here

clicknext

insert image description here

Enter the MySQL root password, remember, after setting the password, clicknext

insert image description here

Click next, note: the service name here defaults toMySQL80

insert image description here

clickExecute

insert image description here

finish installation

insert image description here

clickcancel

insert image description here
chooseYes

insert image description here

In this way, MySQL is successfully installed under Windows

(2) Start and stop

After the MySQL installation is complete, it will be automatically registered as a system service. It is in the startup state by default, and it is self-starting. If you want to stop MySQL, you can win + Ropen it and .services.mscMySQL

Or operate through commands (need to be executed as an administrator):

start: net start mysql80
stop:net stop mysql80

For example:

insert image description here
insert image description here

(3) Client connection

Method 1: The client command tool provided by MySQL

insert image description here

Double click to open, enter password

insert image description here

Method 2: Execute the command with the command line tool that comes with the system

instruction:mysql [-h 127.0.0.1] [-P 3306] -u root -p

Note: To execute the above command in any directory, you must configure the PATH environment variable

(4) Configure MySQL global environment variables

Configure environment variables: Open 我的电脑(此电脑)-> Mouse 右键-> Select 属性-> Find 高级系统设置-> Select环境变量

insert image description here
select Path, click编辑

insert image description here
Find the installation path of the MySQL server:C:\Program Files\MySQL\MySQL Server 8.0\bin

insert image description here

Configure this path Pathinto

insert image description here

keep clicking确定

Now you can directly open MySQL with system commands

insert image description here

4. Uninstall

First call up the system service, win + Ropen the run, enter services.msc, click确定

insert image description here
Find the MySQL program and 右键select 停止Run

insert image description here

open 控制面板, select卸载程序

insert image description here
Uninstall MySQL related components

insert image description here


5. Possible problems

(1) Use the database management tool to connect to the TimesPlugin caching_sha2_password could not be loaded:********

insert image description here

The new version of MySQL uses it caching_sha2_passwordas , while the old version uses it mysql_native_password. When an error is reported when connecting to MySQL plugin caching_sha2_password could not be loaded, you can switch back to the old version of the plug-in.

solution:

After logging in to mysql from the command line, modify the user's authentication plug-in

# 修改 root 用户的身份验证插件为 mysql_native_password
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

# 刷新
FLUSH PRIVILEGES

insert image description here

reconnect

insert image description here


Reference blog:
SQLyog error number plugin caching_sha2_password could not be loaded

おすすめ

転載: blog.csdn.net/xhmico/article/details/125029286