配置my.ini文件

[client]
port=3306
default-character-set=utf8
[mysqld]
# 设置为自己MYSQL的安装目录
basedir=D:\Program Files\MySQL\MySQL Server 5.7-3306
# 设置为MYSQL的数据目录
datadir=D:\Program Files\MySQL\MySQL Server 5.7-3306\data
#设置3306端口
port=3306
# 服务端使用的字符集默认为8比特编码的latin1字符集
character_set_server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#开启查询缓存
explicit_defaults_for_timestamp=true
skip-grant-tables

在dos命令下进入mysql的bin目录 ,执行

mysqld --install mysqld_3306 (重命名服务名是为了方便多实例安装)

mysqld --initialize

windows环境下安装mysql5.7.20-LMLPHP

密码在后缀名为err的文件中

--02T12::.832824Z  [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
--02T12::.832824Z [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
--02T12::.782828Z [Warning] InnoDB: New log files created, LSN=
--02T12::.344429Z [Warning] InnoDB: Creating foreign key constraint system tables.
--02T12::.531629Z [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 40ec5e78-cd7f-11e9-be0a-7c7a911e77d7.
--02T12::.578429Z [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
--02T12::.609629Z [Note] A temporary password is generated for root@localhost: xgylo1yich+V
--02T12::.978088Z [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
--02T12::.978088Z [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
--02T12::.978088Z [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
--02T12::.978088Z [Note] mysqld_3306 (mysqld 5.7.) starting as process ...
--02T12::.993688Z [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
--02T12::.993688Z [Note] InnoDB: Uses event mutexes
--02T12::.993688Z [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
--02T12::.993688Z [Note] InnoDB: Compressed tables use zlib 1.2.
--02T12::.993688Z [Note] InnoDB: Number of pools:
--02T12::.993688Z [Note] InnoDB: Not using CPU crc32 instructions
--02T12::.993688Z [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = , chunk size = 128M
--02T

mysql 8.0.15 安装步骤有点差异 初始化使用

mysqld --initialize  --console

密码会在控制台打印出来

windows环境下安装mysql5.7.20-LMLPHP

首次登录需要修改密码,不然使用navicat会提示密码过期

windows环境下安装mysql5.7.20-LMLPHP

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

  

05-17 18:36