Article Directory
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/
After entering the official website, clickDOWNLOADS
enter the page
We can directly download the community version of MySQL here, clickMySQL Community (GPL) Downloads >>
Here you can see that the official provides many forms of downloads,
Click MySQL Intaller for Windows
to enter the following page and then Download
click to download the installation package.
----------------------------------------------------
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
clicknext
clicknext
chooseYes
Click Excute
to install the related components of MySQL, this process may take a few minutes
clicknext
clicknext
clicknext
Enter the MySQL root password, remember, after setting the password, clicknext
Click next
, note: the service name here defaults toMySQL80
clickExecute
finish installation
clickcancel
chooseYes
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 + R
open it and .services.msc
MySQL
Or operate through commands (need to be executed as an administrator):
start: net start mysql80
stop:net stop mysql80
For example:
(3) Client connection
Method 1: The client command tool provided by MySQL
Double click to open, enter password
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环境变量
select Path
, click编辑
Find the installation path of the MySQL server:C:\Program Files\MySQL\MySQL Server 8.0\bin
Configure this path Path
into
keep clicking确定
Now you can directly open MySQL with system commands
4. Uninstall
First call up the system service, win + R
open the run, enter services.msc
, click确定
Find the MySQL program and 右键
select 停止
Run
open 控制面板
, select卸载程序
Uninstall MySQL related components
5. Possible problems
(1) Use the database management tool to connect to the TimesPlugin caching_sha2_password could not be loaded:********
The new version of MySQL uses it caching_sha2_password
as , 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;
reconnect
Reference blog:
SQLyog error number plugin caching_sha2_password could not be loaded