当前位置:网站首页>Install MySQL version 5.7 or above on windows (install in compressed package)

Install MySQL version 5.7 or above on windows (install in compressed package)

2022-06-11 10:29:00 It's hard not to write code all day

1 download

First, open the official website for downloading

https://dev.mysql.com/downloads/

 Insert picture description here
Go in and choose 5.7 edition

 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here

2 install

Unzip after download , After decompression, it is as follows (zip It's installation free , After decompression and configuration, you can use )

Be careful : Only 5.6 Only the previous version can be installed online (install msi),5.7 After that, it was zip Compressed version

2.1 Configure environment variables

After decompression , Directly configure environment variables

 Insert picture description here

2.2 Write profile

take my.ini Put in Installation directory
 Insert picture description here
 Insert picture description here

The contents of the document are as follows :

[client]
port=3306
default-character-set=utf8
[mysqld] 
#  Set it to itself MYSQL Installation directory  
basedir=D:/softinstall/mysql5.7/mysql-5.7.38-winx64
#  Set to MYSQL Data directory for  
datadir=D:/softinstall/mysql5.7/mysql-5.7.38-winx64/data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
# Turn on query cache 
explicit_defaults_for_timestamp=true
skip-grant-tables
max_allowed_packet = 400M

Be careful :basedir and datadir Use... Between folders “/” instead of “\”, Otherwise, errors may occur in the following operations . It is also said that stay my.ini The correct path in the requires double “\”.

2.3 cmd It's installed inside

Open as administrator cmd Command window , Switch directory to MySQL Of the installation directory bin Under the table of contents
Get into mysql Of bin Execute... After directory

mysqld install

 Insert picture description here
initialization

After executing this command

mysqld --initialize-insecure --user=mysql

, At this time mysql Just create one for yourself data Folder . If there is such a problem , Tips Can’ t create directory .

 Insert picture description here

net start mysql  command ( start-up MYSQL command )

net stop mysql  command ( stop it MYSQL command )

 Insert picture description here

UPDATE mysql.user SET authentication_string = PASSWORD(' password ') WHERE user = 'root';

#  My orders  
UPDATE mysql.user SET authentication_string = PASSWORD('123456') WHERE user = 'root';

FLUSH PRIVILEGES;

 Insert picture description here
The above changes the password

 Insert picture description here
 Insert picture description here

原网站

版权声明
本文为[It's hard not to write code all day]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111018366797.html