当前位置:网站首页>Windows 安装 MySQL 5.7详细步骤
Windows 安装 MySQL 5.7详细步骤
2022-07-29 08:11:00 【Bejpse】
文章目录
本文主要介绍了 Windows 系统中安装 MySQL 5.7 的详细步骤,以及环境变量配置和文件配置。
下载
MySQL :: Download MySQL Community Server (Archived Versions)
https://downloads.mysql.com/archives/community/
选择 5.7.* 版本,然后选择 zip 文件进行下载
解压
将下载的文件解压到自己安装软件的目录,我这里是C:Softwaremysql-5.7.28
设置环境变量
依次点击 此电脑 — 属性 — 高级系统设置 — 环境变量,然后新建系统变量
MYSQL_HOME
C:Softwaremysql-5.7.28
在 “Path”变量中添加%MYSQL_HOME%in
创建数据目录
在C:Softwaremysql-5.7.28目录中分别创建data和uploads文件夹,分别存放MySQL数据和导入导出文件。
创建配置文件
在C:Softwaremysql-5.7.28目录中创建my.ini文件,涉及到目录文件的跟进自己情况做修改。
[mysqld]
port=3306
character_set_server=utf8
basedir=C:Softwaremysql-5.7.28
datadir=C:Softwaremysql-5.7.28data
server-id=1
sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
lower_case_table_names=1
innodb_file_per_table = 1
log_timestamps=SYSTEM
log-error = error.log
slow_query_log = 1
slow_query_log_file = slow.log
long_query_time = 5
log-bin = binlog
binlog_format = row
expire_logs_days = 15
log_bin_trust_function_creators = 1
secure-file-priv=C:Softwaremysql-5.7.28uploads
[client]
default-character-set=utf8
整体目录结构为
初始化数据库
以管理员的身份运行 CMD
切换到 MySQL 的HOME 目录,然后执行mysqld --initialize-insecure
cd c:Softwaremysql-5.7.28
mysqld --initialize-insecure
安装并启动
切换到bin目录中,执行mysqld –install MySQL57安装,然后再执行net start MySQL57启动 MySQL
cd bin
mysqld –install MySQL57
net start MySQL57
设置登录密码
先使用mysql -uroot登录 MySQL
设置本地登录密码为“Root-123”和远程登录密码“Root-123456”
mysql -uroot
SET PASSWORD FOR 'root'@'localhost'= "Root-123";
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Root-123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;
参考资料
Windows安装MySQL5.7教程 - 简书
https://www.jianshu.com/p/a41d45890ab2
注:本文首发于个人博客网站: http://www.erik-ly.com/
边栏推荐
- Operator overloading
- Simplefoc parameter adjustment 1-torque control
- An Optimal Buffer Management Scheme with Dynamic Thresholds论文总结
- Alibaba political commissar system - Chapter III, Alibaba political commissar and cultural docking
- 【NOI模拟赛】计算几何(凸包,暴力,并查集)
- LVM logical volume group management
- In an SQL file, a test table and data are defined above, and you can select* from the test table below
- 网络安全之安全基线
- Dynamic thresholds buffer management in a shared buffer packet switch paper summary
- What is Amazon self support number and what should sellers do?
猜你喜欢

Implementation of simple cubecap+fresnel shader in unity

Unity多人联机框架Mirro学习记录(一)

Rotation in model space and rotation in world space

Tcp/ip five layer reference model and corresponding typical devices and IPv6

Simplefoc parameter adjustment 2- speed and position control

阿里巴巴政委体系-第一章、政委建在连队上

网络安全之安全基线

Redshift 2.6.41 for maya2018 watermark removal

Unity Shader学习(六)实现雷达扫描效果
![[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient](/img/d1/5b980d8b9580b9808b2b3f51d5b9c6.png)
[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient
随机推荐
NFC two-way communication 13.56MHz contactless reader chip -- si512 replaces pn512
Inclination monitoring solution of Internet of things
Qt/pyqt window type and window flag
分段分页以及段页结合
Tb6600+stm32f407 test
Compatible with cc1101/cmt2300-dp4301 sub-1g wireless transceiver chip
阿里巴巴政委体系-第四章、政委建在连队上
The software package is set to - > Yum source
(视频+图文)机器学习入门系列-第5章 机器学习实践
STM32 serial port garbled
Day 014 2D array exercise
20 hacker artifacts
Taiyuan bus route crawling
125kHz wake-up function 2.4GHz single transmitter chip-si24r2h
Unicode private use areas
[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient
Greenplus enterprise deployment
Simple calculator wechat applet project source code
Tcp/ip five layer reference model and corresponding typical devices and IPv6
数仓分层设计及数据同步问题,,220728,,,,