首页 > 数据库 >win10搭建mysql5.7环境

win10搭建mysql5.7环境

时间:2024-02-25 12:12:01浏览次数:26  
标签:Files set 5.7 mysql5.7 Program mysql win10 44 搭建

下载mysql5.7

下载官网地址 https://downloads.mysql.com/archives/community/

解压到指定目录

我解压到 D:\Program Files\mysql-5.7.44

创建配置文件 my.ini

在上述目录中创建 my.ini 文件,并添加如下配置项

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
port = 3306
default-character-set=utf8
[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
character_set_server=utf8
init_connect='SET NAMES utf8'
basedir = D:\Program Files\mysql-5.7.44
datadir = D:\Program Files\mysql-5.7.44\data
port = 3306
default-storage-engine=INNODB
# server_id = .....


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

注意:

basedir = D:\Program Files\mysql-5.7.44 //这里改成你自己的安装目录
datadir = D:\Program Files\mysql-5.7.44\data //改成 安装目录\data 这个路径存放你的数据文件

配置环境变量

安装数据库服务

以管理员身份运行 cmd
执行以下命令
mysqld -install

数据库初始化

mysqld --defaults-file="D:/Program Files/mysql-5.7.44/my.ini" --initialize --console


红框内是产生的随机密码,把它记录下来。待会登录mysql要用。

启动数据库服务

net start mysql

登录并修改密码

mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';

参考资料
https://www.jianshu.com/p/ea4accd7afb4
https://www.cnblogs.com/f-society/p/6902057.html

标签:Files,set,5.7,mysql5.7,Program,mysql,win10,44,搭建
From: https://www.cnblogs.com/zhaopengcheng/p/18032237

相关文章

  • Doris Fe在Mac上搭建开发环境踩坑记录
    1.拉取代码到本地gitclonehttps://github.com/apache/doris.git2.参考Doris的文档,但别全信(信了你就上当了)参考第一篇https://doris.apache.org/zh-CN/community/developer-guide/fe-idea-dev/这里的环境准备jdk必须1.8及以上maven必须3.5.4及以上(否则会报错,不过错......
  • windows如何同时安装两个不同版本的Mysql(Mysql8.0+Mysql5.7)
    1.问题由于公司要求使用mysql版本为Mysql5.7,而我之前的项目均是使用Mysql8.0,为了避免卸载重新安装Mysql5.7可能导致的问题,便寻找了可以同时在Windows上安装两个不同版本Mysql的方法2.解决参考:windows如何同时安装两个不同版本的Mysql(Mysql8.0+Mysql5.7)2.1进入你下载解压后......
  • win10系统中环境变量path变成一行显示
    1.问题编辑系统环境变量发现只显示出了一行,而不是以前的一个列表,看起来十分麻烦2.解决参考:win10系统中环境变量path变成一行显示要把这个放在最前面.C:\Windows\System32;......
  • containerd环境搭建指南
    目录一.container概述1.什么是containerd2.为什么要学习containerd二.基于yum方式安装containerd1.获取软件源2.查看yum源中containerd软件版本3.安装containerd的4.查看containerd的版本信息5.设置containerd开机自启动6.查看containerd的客户端和服务端的版本信息三.基于二进制......
  • linux(ubuntu22.04)+PicGo(gui版)+阿里云oss搭建图床教程
    linux(ubuntu22.04)+PicGo(gui版)+阿里云oss搭建图床教程资源库PicGo下载链接:山东镜像源github原版阿里云oss链接linux下PicGo(gui版)的安装从资源库链接里下载后缀为.AppImage的安装包,版本可以选择稳定版2.3.1也可以用更新的beta版。修改文件权限,打开文......
  • Linux搭建SFTP
    Linux搭建SFTP一、 创建sftp用户组(注:通常选择home路径下,按需自行调整)1、 创建sftp用户组根目录(详情看第4点)mkdir/home/sftpUsers/name创建单个用户name:addusername//新建name用户passwdname//给name用户设置密码—部分需要设置复杂密码包含数字,且长度不小于8位nam......
  • Unity xLua开发环境搭建与基础进阶
    Unity是一款非常流行的游戏开发引擎,而xLua是一个为Unity开发者提供的Lua框架,可以让开发者使用Lua语言来进行游戏开发。在本文中,我们将介绍如何搭建UnityxLua开发环境,并进行基础进阶的学习。 对啦!这里有个游戏开发交流小组里面聚集了一帮热爱学习游戏的零基础小白,也有一些正......
  • 02-23整理 MySQL主从库搭建过程
    主从库搭建需要主库从库均有配置,井号#之后部分为注释主库:#创建数据同步用户账号,自行替换变量createuser${slaveuser}@'${ip}'identifiedby'${password}';grantreplicationslaveon*.*to${slaveuser}@'ip';#查看用户被授权限:showgrantsfor${slaveuser}@'ip';......
  • 搭建私有的 PyPI 服务器
    安装教程安装pypi-server:pipinstallpypiserver创建一个存储PyPI包的目录:mkdir~/pypi-packages启动pypi-server,需要生成用户名密码文件及安装配套服务pypi-serverrun-p8080-P~/.htpasswd--overwrite~/pypi-packages配置PyPI客户端以使用你的......
  • OpenSceneGraph环境搭建
    OpenSceneGraph开发环境搭建环境说明windows10visualstudio2019qt5.15预编译库与资源这是最省事的方式,本人懒得走cmake编译那套,而且有现成的为何不用,省点时间研究OSG不香吗?下载预编译库,点此进入,可看到如下页面,点击StableReleasesStableReleases页面如下:......