1. Unzip to the location you want to install, create the My.ini file
The contents of My.ini are as follows
[mysql]# set MySQL client default character set Default-character-set=utf8[mysqld] #设置3306端口port = 3306# Set the installation directory for MySQL Basedir=d:\program files\mysql-5.7.21-winx64# set the data storage directory for the MySQL database Datadir=d:\program files\mysql-5.7.21-winx64\data# allow the maximum number of connections Max_ The character set used by the connections=200# service side defaults to a 8-bit encoded latin1 character set character-set-server=utf8# the default storage engine that will be used when creating a new table default-storage-engine= INNODB
2. Open the cmd command line with Administrator privileges
3. Switch to the Bin folder directory of the installation directory, initialize the data folder, because there is no data folder in the extracted directory, do not manually create
--the command to initialize is as follows
Mysqld--defaults-file= "D:\Program Files\mysql-5.7.21-winx64\my.ini"--initialize-insecure
--Install MySQL service
Mysqld-install MySql57
--Start the MySQL service
net start MySql57
4, modify the initial root account password, the default is no password, direct input command
Mysql-u Root
Show database;
Use MySQL;
UPDATE user SET Authentication_string=password ("YourPassword") WHERE user= ' root ';
FLUSH privileges; QUIT;
MYSQL 5.7.21 Configuration under Install-free version Win10