Install mysql-5.7.19-winx64 under win10

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
write picture description here
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)
write picture description here

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
write picture description here

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~
write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325442155&siteId=291194637
Recommended