D:\ProgramGreen\mysql-8.0.16-winx64\bin>mysqld --initialize --console 2020-01-17T11:23:23.650263Z 0 [System] [MY-013169] [Server] D:\ProgramGreen\mysq l-8.0.16-winx64\bin\mysqld.exe (mysqld 8.0.16) initializing of server in progres s as process 8272 2020-01-17T11:23:23.659264Z 0 [Warning] [MY-013242] [Server] --character-set-ser ver: 'utf8'is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. 2020-01-17T11:24:42.173755Z 5 [Note] [MY-010454] [Server] A temporary password i s generated for root@localhost: 【eEa3h!8_5%dK】#括号里即默认密码 2020-01-17T11:25:10.701386Z 0 [System] [MY-013170] [Server] D:\ProgramGreen\mysq l-8.0.16-winx64\bin\mysqld.exe (mysqld 8.0.16) initializing of server has comple ted
D:\ProgramGreen\mysql-8.0.16-winx64\bin>mysqld --install Service successfully installed.
D:\ProgramGreen\mysql-8.0.16-winx64\bin>net start mysql MySQL 服务正在启动 ........ MySQL 服务无法启动。
请键入 NET HELPMSG 3523 以获得更多的帮助。 如果不成功,打开任务管理器,结束mysql相关进程即可
D:\ProgramGreen\mysql-8.0.16-winx64\bin>net start mysql MySQL 服务正在启动 .... MySQL 服务已经启动成功。
D:\ProgramGreen\mysql-8.0.16-winx64\bin>
8.2 连接数据库,并修改默认密码set password='root';
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
D:\ProgramGreen\mysql-8.0.16-winx64\bin>mysql -uroot -p Enter password: ************ Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is9 Server version: 8.0.16
Copyright (c) 2000, 2019, 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> set password='root'; Query OK, 0 rows affected (0.01 sec)