windows10 安装 mysql-5.7.23-winx64

1 下载mysql-5.7.23-winx64
    mysql-5.7.23-winx64下载地址: https://dev.mysql.com/downloads/mysql/5.7.html#downloads
2 解压目录如下 
    D:\tools\mysql-5.7.23-winx64
3 新建my.ini文件
    在D:\tools\mysql-5.7.23-winx64下新建my.ini文件(由于mysql该版本没有初始化文件,需自己创建)
如my.ini内容
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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.

[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的缓存,可以根据实际情况调整大小,我这里采取默认值
  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.
  #mysql根目录
  #basedir = D:\tools\mysql-5.7.23-winx64
  #数据存储目录
  #datadir = D:\tools\mysql-5.7.23-winx64\data
  #端口号,默认为3306
  port = 3302
  #服务实例的唯一标识,这个是做集群的时候使用,单例可以不配置
# 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 
  #配置一下服务端的字符集
  character_set_server=utf8
  sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#配置一下客户端的字符集
[client]   
default-character-set=utf8
4 配置环境变量
    新增  MYSQL_HOME D:\tools\mysql-5.7.23-winx64
    Path下追加 %MYSQL_HOME%\bin
5 在管理员下使用cmd
    进入c:\Windows\System32目录下搜索cmd.exe点击右键使用管理员执行
6 执行命令 
    进入D:\tools\mysql-5.7.23-winx64\bin目录下
    执行 mysqld --initialize
7 注册 
    mysqld --install MySQL57
8 启动 
    net start MySQL57
9 查看mysql给root分配的随机密码,用于登录 
    查看文件路径D:\tools\mysql-5.7.23-winx64\data路径下的.err文件如下:
    `2018-09-12T05:56:56.481677Z 1 [Note] A temporary password is generated for root@localhost: 9b/hqaO/z9Yy`
10 登录 
    mysql -u root -P 3302 -p 输入上步骤中密码即可
11 修改密码 
    alter user `root`@`localhost` identified by '123456';
12 刷新权限 
    flush privileges;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值