Step1
Official download address https://dev.mysql.com/downloads/mysql/
Select manual download version
Unzip to the path specified by yourself The my.ini and data folders in the
above picture are not in the compressed package, you need to add them later
my.ini is as follows, copy directly~
[client]
port=3306
default-character-set=utf8
[mysqld]
# 设置为自己MYSQL的安装目录
basedir=D:\Mysql\mysql-5.7.19-winx64
# 设置为MYSQL的数据目录
datadir=D:\Mysql\mysql-5.7.19-winx64\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
#开启查询缓存
explicit_defaults_for_timestamp=true
skip-grant-tables
Then create a data folder in the directory
Step2
Set environment variables
Computer->Properties->Advanced System Properties->Environment Variables Create a new one in Path
in the system variables (%MYSQL installation directory%\bin)
Step3
Go to the bin folder in the Mysql installation directory, and open cmd here as an administrator
Execute mysqld --initialize-insecure
This command is to make the normal mysql folder and related files in the data directory.
If error: Found option without preceding group in config file: D:\Mysql\mysql-5.7.19-winx64\my.ini at line: 1 appears
, the solution is to save my.ini in ANSI format
Then execute the following commands in sequence (admin mode):
mysqld install
net start mysql
If you need to change the password, enter:
set password for root@localhost = password(‘123456’);
Step4
Done~
mysql -u root -p log in and try~