D:/MySQL/mysql-8.0.20-winx64/bin>mysqld --initialize --console 2020-05-10T11:26:21.895908Z 0 [System] [MY-013169] [Server] D:/MySQL/mysql-8.0.20-winx64/bin/mysqld.exe (mysqld 8.0.20) initializing of server in progress as process 9764 2020-05-10T11:26:21.897278Z 0 [Warning] [MY-013242] [Server] --character-set-server: '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-05-10T11:26:21.915225Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2020-05-10T11:26:22.619057Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2020-05-10T11:26:24.265774Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 9Zh41zk-@mof 輸入mysqld --install(如果需要安裝多個mysql服務,這步輸入mysqld --install [服務名])
D:/MySQL/mysql-8.0.20-winx64/bin>net start mysql The MySQL service is starting. The MySQL service was started successfully. 輸入mysql -u root -p,使用初始密碼登錄mysql,在Enter password后輸入初始密碼
D:/MySQL/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 8 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. 登錄后,把初始密碼修改掉,可以設置成自己容易記住的密碼。 輸入ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '自己定義的密碼'; (分號一定要帶)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '自己定義的密碼; Query OK, 0 rows affected (0.02 sec) 到這一步就完成了 輸入show database; ,可以查看包含哪些數據表
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.01 sec) 看完這篇關于Win10下怎么安裝配置mysql 8.0.20的文章,如果覺得文章內容寫得不錯的話,可以把它分享出去給更多人看到。