以下命令在管理员权限下执行
D:\......\mysql-5.7.9-winx64\bin>mysqld --initialize --user=mysql --console
2015-10-29T15:54:04.603600Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-10-29T15:54:04.603600Z 0 [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.
2015-10-29T15:54:04.603600Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2015-10-29T15:54:06.578744Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-10-29T15:54:07.113742Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-10-29T15:54:07.272894Z 0 [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: 495b8a7c-7e55-11e5-be02-d8cb8a5dd36f.
2015-10-29T15:54:07.305924Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2015-10-29T15:54:07.322941Z 1 [Note] A temporary password is generated for root@localhost: JgAg-YLb+2-<
注意:这个是临时密码JgAg-YLb+2-<
D:\.....\mysql-5.7.9-winx64\bin>mysqld install
Service successfully installed.
就这些,你可以启动mysql了
使用命令mysql -uroot -p登录
使用命令set password = password('root')
来修改当前用户密码为root