cmd(管理员)

Microsoft Windows [版本 10.0.14393]
(c) 2016 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>cd C:\Program Files\MySql\mysql-5.7.36-winx64\bin

C:\Program Files\MySql\mysql-5.7.36-winx64\bin>mysqld –install
Service successfully installed.

C:\Program Files\MySql\mysql-5.7.36-winx64\bin>mysqld –initialize –console
2021-12-19T13:17:31.825100Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-12-19T13:17:31.984439Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-12-19T13:17:32.061320Z 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: 05ed040f-60ce-11ec-a86e-525400f3f4eb.
2021-12-19T13:17:32.067267Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed’ cannot be opened.
2021-12-19T13:17:34.113672Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2021-12-19T13:17:34.117029Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2021-12-19T13:17:34.127666Z 0 [Warning] CA certificate ca.pem is self signed.
2021-12-19T13:17:34.440073Z 1 [Note] A temporary password is generated for root@localhost: pM>vMZw1ouv&

C:\Program Files\MySql\mysql-5.7.36-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

C:\Program Files\MySql\mysql-5.7.36-winx64\bin>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.36

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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 = password(‘root’);
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> exit
Bye

C:\Program Files\MySql\mysql-5.7.36-winx64\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.36 MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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> exit
Bye

C:\Program Files\MySql\mysql-5.7.36-winx64\bin>

[mysql]
ysql]