当前位置:网站首页>Windows 安装MySQL5.7 以上的版本(压缩包形式安装)
Windows 安装MySQL5.7 以上的版本(压缩包形式安装)
2022-06-11 10:19:00 【一天不写代码难受】
1 下载
首先打开官网进行下载
https://dev.mysql.com/downloads/

进去之后选择5.7版本





2 安装
下载完成后解压,解压后如下(zip是免安装的,解压后配置成功即可使用)
注意:只有5.6以前的版本才有在线安装(install msi),5.7之后都是zip压缩版
2.1 配置环境变量
解压之后,直接配置环境变量

2.2 写配置文件
将 my.ini 放置在 安装目录下

文件的内容如下:
[client]
port=3306
default-character-set=utf8
[mysqld]
# 设置为自己MYSQL的安装目录
basedir=D:/softinstall/mysql5.7/mysql-5.7.38-winx64
# 设置为MYSQL的数据目录
datadir=D:/softinstall/mysql5.7/mysql-5.7.38-winx64/data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
#开启查询缓存
explicit_defaults_for_timestamp=true
skip-grant-tables
max_allowed_packet = 400M
注意:basedir和datadir 的文件夹之间用“/”而不是“\”,否则在下面的操作中可能会出错。也有说是 在my.ini中正确的路径都需要双“\”。
2.3 cmd 里面进行安装
以管理员身份打开cmd命令窗口,将目录切换到MySQL的安装目录的bin目录下
进入mysql的bin目录后执行
mysqld install

初始化
执行完这条命令
mysqld --initialize-insecure --user=mysql
,这时mysql就帮你自己创建一个data文件夹。如果出现这样的问题,提示Can’ t create directory 。

net start mysql 命令(启动MYSQL命令)
net stop mysql 命令(停止MYSQL命令)

UPDATE mysql.user SET authentication_string = PASSWORD('密码') WHERE user = 'root';
# 我的命令
UPDATE mysql.user SET authentication_string = PASSWORD('123456') WHERE user = 'root';
FLUSH PRIVILEGES;

以上就修改了密码


边栏推荐
- Detailed explanation of Lora module wireless transceiver communication technology
- After four years of outsourcing, it was abandoned
- Finish C language
- [image denoising] image denoising based on median + wavelet + Wiener + filter, including Matlab source code
- 本人书签常存的地址
- UGUI
- 使用bat向文件的第一行中写入内容
- Internet of things security in the era of remote work
- UGUI
- DOtween使用方法
猜你喜欢

TikTok在英国遭遇文化冲突,短期内众多员工离职

对于力士乐电磁换向阀的功能与作用,你知道多少

What are the functions and functions of the EMG actuator

What are the functions and applications of Mogg test controller

What are the ABAP keywords and syntax that cannot be used in the ABAP cloud environment?

MOSFET的SOA或者ASO是什么?

UGUI

Introduction to ZigBee module wireless transmission star topology networking structure

ZigBee模块无线传输星形拓扑组网结构简介

动态渲染数据和轮播图
随机推荐
Beginning简约博客emlog主题模板V3
New feature of ES6 - arrow function
Ugui picture wall
RSA signature issues
MySQL transaction
Mysql--索引
Address of my bookmark
用真金做的电路板——金手指
parker派克先导式电磁阀和直动式电磁阀的区别有哪些?
Picture rule page turning
使用bat向文件的第一行中写入内容
帝国CMS仿《游戏鸟》模板源码/92kaifa版大型手机游戏门户网站模板
Drink at night, 50 classic SQL questions, really fragrant~
puppeteer入门之 Puppeteer 类
MySQL 权限管理和备份
电子设备辐射EMC整改案例
Detailed explanation of Lora module wireless transceiver communication technology
puppeteer入门之 Browser 类
Empire CMS imitation "game bird" template source code /92kaifa version large mobile game portal template
Es6新特性——箭头函数