windows安装包安装mysql5.7_Windows7 64位压缩包安装MySQL5.7.9

官网下载64bit MySQL5.7.9压缩包, 解压至安装位置

1. 创建my.ini文件, 内容如下

[mysqld]

# Remove leading # and set to the amount of RAMforthe most important data

# cachein 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.

basedir=C:/webserver/mysql

datadir=C:/webserver/mysql/data

port=6033# server_id=.....

# Remove leading # to set options mainly usefulforreporting servers.

# The server defaults are fasterfortransactions and fast SELECTs.

# Adjust sizes as needed, experiment tofindthe optimal values.

join_buffer_size=128M

sort_buffer_size=2M

read_rnd_buffer_size=2M

bulk_insert_buffer_size=16M

innodb_flush_log_at_trx_commit= 0sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

2. 初始化数据库

path-to-mysqlinmysqld.exe --initialize

生成的root密码在data目录下的.err文件中能找到, 注意密码包含符号, 如果最后一个是" 或者), 不要漏掉

3. 第一次启动

path-to-mysqlinmysqld.exe --console 或者

path-to-mysqlinmysqld.exe --log-error 或者

path-to-mysqlinmysqld.exe --standalone

客户端连接, 执行

path-to-mysqlinmysql -P 6033 -u root -p

# 指定编码的连接

path-to-mysqlinmysql.exe -P 6033 -u root -p --default-character-set=utf8

第一次登入时, 会要求你必须修改密码

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

修改下密码就可以了

mysql> SET PASSWORD = PASSWORD('root');

停止MySQL, 要新开命令行窗口, 执行

path-to-mysqlinmysqladmin.exe -P 6033 -u root -p shutdown

4. 安装为windows服务

path-to-mysqlinmysqld.exe --install MySQL --defaults-file=path-to-itmysqlmy.ini

#移除服务

path-to-mysqlinmysqld.exe --remove

5. 启动/停止服务

net start mysql

net stop mysql

附win7下的各服务启动/关闭脚本, 保存为.bat, 运行时必须以管理员身份

@echo off

netstop memcachednetstop MySQLnet stop Apache2.4

net startmemcachednet start Apache2.4

net startMySQLpause

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值