win11安装MySQL

 

参考文档:https://dev.mysql.com/doc/refman/8.4/en/

 

1. 下载

 

   mysql官网下载msi安装程序:https://dev.mysql.com/downloads/file/?id=526927

 

2. 安装

 

   运行下载的mis程序,逐步安装。

  • 安装模式: complete;

 

 

 

 

  • 进入配置:

 

 

 

 

  • data directory: mysql所有进行管理的物理数据存储路径,自行定义。

 

 

 

 

  • Type and Networking -Server Configuration Type: 不同的服务器配置模式对主机内存占用不同,本文使用development,针对个人电脑(typically this is your personal workstation).

  • Type and Networking -Connectivity: 定义如何连接到此MYSQL服务端。协议跟端口及windows端口防火墙均默认即可。named pipe参数用来授权用户访问级别,推荐Minimum access to all users (RECOMMENDED),Shared Memory参数用来定义共享内存连接,在同一台主机上定义多个mysql实例时有用。此参数区分大小写。

 

 

 

 

 

 

 

  • 高级配置不勾选show advanced选项,太麻烦辽

  • 账户角色: 记录root用户密码。其他用户有必要的话新增即可

 

 

 

  • 服务运行模式: 默认以windows服务模式自动运行,由windows服务统一管理。或者以mysql服务程序方式手动运行。此处我们默认windows统一管理运行。运行用户默认,保证权限。

 

 

 

 

  • 服务文件权限: 默认第一项服务运行用户及管理员组。

 

 

 

 

  • 演示数据库: 建不建无所谓。

 

 

 

 

  • 应用配置并等待完成即可:

 

 

 

应用配置时可能会报如下失败:

 

 

进入windows服务管理,将mysql84服务的登录属性调整为本地系统账户即可:

 

 

配置日志如下:

Beginning configuration step: Writing configuration file

Saving my.ini configuration file...
Saved my.ini configuration file.
Ended configuration step: Writing configuration file

Beginning configuration step: Updating Windows Firewall rules

Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 3306" protocol=TCP localport=3306

已删除 1 规则。
确定。


Adding a Windows Firewall rule for MySQL84 on port 3306.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow
确定。


Successfully added the Windows Firewall rule.
Adding a Windows Firewall rule for MySQL84 on port 33060.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 33060" protocol=TCP localport=33060 dir=in action=allow
确定。


Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules

Beginning configuration step: Adjusting Windows service

Attempting to grant the required filesystem permissions to the 'NT AUTHORITY\NetworkService' account.
Granted permissions to the data directory.
Granted permissions to the install directory.
Adding new service
New service added
Ended configuration step: Adjusting Windows service

Beginning configuration step: Starting the server

Attempting to start service MySQL84...
MySQL Server - start.
C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqld.exe (mysqld 8.4.0) starting as process 33368
InnoDB initialization has started.
InnoDB initialization has ended.
CA certificate ca.pem is self signed.
Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqld.exe: ready for connections. Version: '8.4.0'  socket: ''  port: 3306  MySQL Community Server - GPL.
X Plugin ready for connections. Bind-address: '::' port: 33060
Successfully started service MySQL84.
Waiting until a connection to MySQL Server 8.4.0 can be established (with a maximum of 10 attempts)...
Retry 1: Attempting to connect to Mysql@localhost:3306 with user root with no password...
Successfully connected to MySQL Server 8.4.0.
Ended configuration step: Starting the server

Beginning configuration step: Updating the Start menu link

Attempting to verify command-line client shortcut.
Verified command-line client shortcut.
Verified command-line client shortcut.
Ended configuration step: Updating the Start menu link

Beginning configuration step: Updating example databases

Updating example databases...
Ended configuration step: Updating example databases
 
posted @ 2024-05-23 08:50  ROGER_FEDERER  阅读(91)  评论(0编辑  收藏  举报