1. 下载

2. 安装|启动
解压缩
将下载后的文件解压缩到 E:\opt\ 下,生成 mysql-8.0.29-winx64 目录
初始化数据库
| C:\Users\Administrator>e: |
| E:\opt>cd mysql-8.0.29-winx64\bin |
| |
| E:\opt\mysql-8.0.29-winx64\bin>mysqld --initialize --console |
| 2022-06-06T15:04:41.229440Z 0 [System] [MY-013169] [Server] E:\opt\mysql-8.0.29-winx64\bin\mysqld.exe (mysqld 8.0.29) initializing of server in progress as process 12228 |
| 2022-06-06T15:04:41.373478Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. |
| 2022-06-06T15:04:47.991509Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. |
| 2022-06-06T15:04:59.857361Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: I&C:,e7Qb>1a |
| |
如上图可见,自动生成的mysql密码为 I&C:,e7Qb>1a
安装mysql服务
| E:\opt\mysql-8.0.29-winx64\bin>mysqld -install |
| Service successfully installed. |
| |
启动mysql
| E:\opt\mysql-8.0.29-winx64\bin>sc start mysql |
| |
| SERVICE_NAME: mysql |
| TYPE : 10 WIN32_OWN_PROCESS |
| STATE : 2 START_PENDING |
| (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) |
| WIN32_EXIT_CODE : 0 (0x0) |
| SERVICE_EXIT_CODE : 0 (0x0) |
| CHECKPOINT : 0x3 |
| WAIT_HINT : 0x3a98 |
| PID : 17136 |
| FLAGS : |
| |
| |
3. 修改密码/密码规则
如果不修改密码规则,navicat报错:Authentication plugin ‘caching_sha2_password’ cannot be loaded

| E:\opt\mysql-8.0.29-winx64\bin>mysql -u root -p |
| Enter password: ************ |
| Welcome to the MySQL monitor. Commands end with ; or \g. |
| Your MySQL connection id is 10 |
| Server version: 8.0.29 |
| |
| Copyright (c) 2000, 2022, 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> ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER; |
| Query OK, 0 rows affected (0.09 sec) |
| mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxxx'; |
| Query OK, 0 rows affected (0.09 sec) |
| |
| mysql> FLUSH PRIVILEGES; |
| Query OK, 0 rows affected (0.05 sec) |
- 结果

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了