mysqld --initialize --console
F:\mysql\mysql5.7.35\bin>mysqld --initialize --console
2022-10-15T02:48:46.260597Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-10-15T02:48:46.771286Z 0 [Warning] InnoDB: New log files created, LSN=45790
2022-10-15T02:48:46.806884Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-10-15T02:48:46.888696Z 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: e3e5d408-4c33-11ed-a627-80e82c7421a3.
2022-10-15T02:48:46.892960Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-10-15T02:48:48.918962Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-10-15T02:48:48.919348Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-10-15T02:48:48.922440Z 0 [Warning] CA certificate ca.pem is self signed.
2022-10-15T02:48:49.269783Z 1 [Note] A temporary password is generated for root@localhost: y%6XXmtSF5pd
# y%6XXmtSF5pd 就是密码
启动mysql
net start mysql
登录mysql
mysql -u root -p
# 密码是刚才输出的 y%6XXmtSF5pd
更改mysql的密码
# ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码';
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';