下载MySQL
https://dev.mysql.com/downloads/file/?id=478884
解压到文件,此例为D盘根目录
在mysql-5.7.23-winx64目录下创建【my.ini】
内容如下:
[mysqld]
port = 3306
basedir=D:/mysql-5.7.23-winx64
datadir=D:/mysql-5.7.23-winx64/data
max_connections=200
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
管理员命令行进入目录,完成安装
D:mysql-5.7.23-winx64in>mysqld --initialize-insecure
D:mysql-5.7.23-winx64in>mysqld install
D:mysql-5.7.23-winx64in>net start mysql
安装完成后初始化密码
D:mysql-5.7.23-winx64in>set password for root@localhost = password('123456');
D:mysql-5.7.23-winx64in>mysql -u root -p