mysql_windows/mysql服务安装/使用zip包来安装mysql服务:Installing MySQL onWindows Using a noinstall ZIP Archive
文章目录
[references]
官网的教程较为啰嗦
MySQL :: MySQL 8.0 Reference Manual
MySQL :: MySQL 8.0 Reference Manual :: 2.3.4 Installing MySQL on Microsoft Windows Using a noinstall ZIP Archive
登录mysql参数介绍:
MySQL :: MySQL 8.0 Reference Manual :: 4.2.4 Connecting to the MySQL Server Using Command Options
third party reference link
在解压目录下创建my.ini
具体的目录名根据个人情况有所不同(我这里修改过目录名)
my.ini
内容
根据注释说明,按自己的喜好修改即可
第一个路径basedir
设置为压缩包解压后的路径
安装命令:
首先颜进入到解压目录下的bin目录下执行
(当然,也可以配置环境变量来简化路径输入)
for cmd:
mysqld.exe --initialize-insecure
for powershell:
./mysqld.exe --initialize-insecure
检查安装结果
如果命令执行中没有报错,那么到您指定的datadir
目录下查看,是否有一个MySQL_Data_Directory
目录
这里的MySQL_Data_Directory
所在目录以你的datadir
为准(在my.ini中的取值)
配置环境变量以及写入path中
可以去配置环境变量,然后可以在新建的终端中直接以mysql
访问程序
可以查询相关文章
安装服务
启用服务
net start mysql
安装版的mysql服务安装(phpstudy)
如果使用了phpstudy之类的管理面板中提供的mysql数据库安装,可以通过配置环境变量,采用类似于zip包的方式安装服务(配置过程比较简单仅给出验证配置是否成功的方法)
验证mysql环境变量配置
where.exe mysqld
PS C:\Users\cxxu> where.exe mysqld D:\phpstudy_pro\Extensions\MySQL8.0.12\bin\mysqld.exe
powershell下安装服务
# 以某种方式进入管理员powershell运行模式 PS C:\Users\cxxu> sudo_pwsh loading envs! loading aliases! loading psReadLines & keyHandler! # 安装服务 PS C:\Users\cxxu> mysqld.exe --install Service successfully installed. PS C:\Users\cxxu> Start-Service mysql WARNING: Waiting for service 'mysql (MySQL)' to start... # 检查服务启动成功 PS C:\Users\cxxu> gsv *mysql* Status Name DisplayName Running MySQL MySQL # 登录mysql用户 PS C:\Users\cxxu> mysqlRootLocal mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.12 MySQL Community Server - GPL Copyright (c) 2000, 2018, 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
访问程序
mysql -u root -p
其实可以直接:
mysql -u root
(这里root 用户的密码采用默认值(空值))
更多查看参数介绍文档
workbench
新版本的mysql将不在发布mysqlWorkbench zip版,但是您可以额外安装workbench/或者使用旧版本
有如下选择
- Download the MSI installer.
- Download the zip archive for version 6.3.8, but remain at that version forever.
- Download the source and build it yourself with Visual Studio 2017 (instructions are in the
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了