Microsoft Windows [版本 6.1.7601]
D:\mysql-8.0.20-winx64\bin>mysqld.exe --initialize --console
D:\mysql-8.0.20-winx64\bin>mysqld --initialize --console
D:\mysql-8.0.20-winx64\bin>mysqld.exe --initialize --console
2021-11-06T01:24:53.548434Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.20-winx64\bin\mysqld.exe (m
ysqld 8.0.20) initializing of server in progress as process 10356
2021-11-06T01:24:53.714443Z 1 [System] [MY-013576] [InnoDB] InnoDB ishnitialization has started.
2021-11-06T01:24:56.692613Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-11-06T01:25:00.480830Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root
@localhost: 2pjN+*T*E(Ck
D:\mysql-8.0.20-winx64\bin>
其中 2pjN+*T*E(Ck 为默认密码
然后以管理员身份运行
Microsoft Windows [版本 6.1.7601]
C:\Windows\system32>d:
D:\>cd mysql-8.0.20-winx64
D:\mysql-8.0.20-winx64>cd bin
D:\mysql-8.0.20-winx64\bin>mysqld.exe --install MYSQL8.0
Service successfully installed.
D:\mysql-8.0.20-winx64\bin>net start mysql8.0
MYSQL8.0 服务正在启动 ..
MYSQL8.0 服务已经启动成功。
D:\mysql-8.0.20-winx64\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.20
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
// 登录成功后 修改密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'r
oot';
Query OK, 0 rows affected (0.01 sec)
mysql> fulsh privileges;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'fulsh
privileges' at line 1
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql>
至此 可以使用 连接工具连接