1.下载MySQL

访问https://dev.mysql.com/downloads/mysql/5.6.html#downloads,下载操作系统对应的版本(无账号需先注册一个),以mysql-5.6.38-win32为例

2.解压

以解压到D:\soft_dev\mysql-5.6.38-win32为例

3.修改配置文件

解压完mysql-5.6.38-win32目录下有一个配置文件模板my-default.ini,复制一份并命名为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_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 = D:/soft_dev/mysql-5.6.38-win32
datadir = D:/soft_dev/mysql-5.6.38-win32/data
# port = .....
# 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 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

注意:

  (1)配置文件起作用的两种方式:创建my.ini、启动服务时指定defaults-file

  (2)basedir、datadir路径中要用/分隔符不能用\,负责启动服务会报配置错误导致的1067错误

  (3)MySQL5.6.8之前会将配置文件直接放到安装目录下,之后的版本在服务启动过程中会按照一定的目录优先级搜素my.ini

4.安装MySQL服务

进入D:\soft_dev\mysql-5.6.38-win32\bin目录,执行mysqld.exe -install安装服务(如果360安全卫士有监测,允许本次操作),mysqld.exe -remove移除服务,效果可在windows服务列表中查看

5.启动服务

任意位置执行net start mysql

此时再查看Windows服务列表MySQL状态为启动,且启动类型为自动

6.远程登陆用户设置

进入D:\soft_dev\mysql-5.6.38-win32\bin目录,执行mysql -uroot,进入mysql,此时为root免密登录

mysql> use mysql;

mysql> select host,user,password from user;

mysql> update user set password=password('123456') where user='root';

mysql> update user set host='%' where user='root' and host='localhost';

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

mysql> flush privileges;

mysql> exit

7.修改字符集及其他配置信息

(1) 查看字符集

(2) 修改字符集,修改后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. [client]
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.
basedir = D:/soft_dev/mysql-5.6.38-win32
datadir = D:/soft_dev/mysql-5.6.38-win32/data
# port = .....
# server_id = .....
character_set_server=utf8
character_set_client=utf8
collation-server=utf8_general_ci
lower_case_table_names=1
max_connections=1000 # 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 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [mysql]
default-character-set = utf8

(3) 重启MySQL服务

再次查看字符集

Win7安装解压版MySQL的更多相关文章

  1. Windows 7安装解压版MySQL 5.6(不包含配置文件优化)

    到官网下载MySQL5.6 下载地址:http://dev.mysql.com/downloads/mysql/5.6.html, 提供了 .exe版本 和 .zip解压版,因为我的操作系统是64位的 ...

  2. Windows10下安装解压版MySQL教程

    MySQL安装分为安装版和解压版,安装版主要是由一个exe程序式安装,有界面鼠标点击安装即可,小白建议使用安装版安装mysql,相比较与安装版,解压版安装更"纯净",没有多余的东西 ...

  3. 【DataBase】 在Windows系统环境 下载和安装 解压版MySQL数据库

    MySQL官网解压版下载地址:https://dev.mysql.com/downloads/mysql/ 为什么不推荐使用安装版?无脑下一步,很多配置的东西学习不到了 点选第一个就好了,下面的是调试 ...

  4. 怎样安装解压版MySQL

    第一步: 解压包. 第二步:引入MySQL的bin路径. 第三步: 在cmd下敲入 mysqld -install 第四步:启动服务 net start mysql 第五步:空password登录 m ...

  5. windows安装解压版mysql

    记录下用批处理安装mysql5.7.18的过程与踩到的坑 先在安装目录新建文件my.ini [mysql] default-character-set=utf8 basedir=TODO datadi ...

  6. Windows下安装zip包解压版mysql

    Windows下安装zip包解压版mysql 虽然官方提供了非常好的安装文件,但是有的时候不想每次再重装系统之后都要安装一遍MySQL,需要使用zip包版本的MySQL.在安装时需如下三步: 1. 新 ...

  7. Mysql安装(解压版)

    文章首推 刷网课请点击这里 刷二级请点击这里 论文查重请点击这里 WIFI破解详细教程 今日主题:Mysql安装(解压版) 环境 系统:windows10 版本:mysql5.7.29 安装过程 1. ...

  8. Linux下安装解压版(tar.gz)MySQL5.7

            最近尝试在Linux中安装了解压版MySQL,期间查阅了许多博客.很多博客看得我很懵逼,因此记录下自己的安装过程,方便后续查阅.         环境说明:CentOs7.2 一.清理 ...

  9. 安装解压版的mariadb

    今天尝试了安装解压版的mariadb,在官网上https://downloads.mariadb.org/下载了5.5版本的mariadb的zip压缩包, 经过实践发现mariadb解压版安装与mys ...

随机推荐

  1. 网页布局——Flex弹性框布局

    布局的传统解决方案,基于盒状模型,依赖 display 属性 + position属性 + float属性.它对于那些特殊布局非常不方便,比如,垂直居中就不容易实现. 需要安卓4.4及以上版本可以使用 ...

  2. Cow Acrobats

    Farmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the ...

  3. python 基本排序算法

    #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/9/15 下午5:06 # @Author : lb # @File : so ...

  4. 编译 lame for iOS

    网上找了许多编译lame的教程,结果都是编译失败,多次尝试后发现是编译脚本放错路径了,记录下编译的过程,把编译脚本放到源码文件夹中和修改编译脚本中的目录是关键: 一.首先去Lame官网 http:// ...

  5. 支撑微博亿级社交平台,小白也能玩转Redis集群(原理篇)

    Redis作为一款性能优异的内存数据库,支撑着微博亿级社交平台,也成为很多互联网公司的标配.这里将以Redis Cluster集群为核心,基于最新的Redis5版本,从原理再到实战,玩转Redis集群 ...

  6. 关于用gulp合并压缩seaJs模块

    现在很多人都在用seaJs来开发项目,seaJs上手容易,操作简单.但在后期做合并压缩的时候却中了个巨大无比的坑,但坑也总得有人来填.于是花了将近一个星期的时间来填了这坑,现将填坑的一些心得与大家分享 ...

  7. [JZOJ5773]【NOIP2008模拟】简单数学题

    Description       话说, 小X是个数学大佬,他喜欢做数学题.有一天,小X想考一考小Y.他问了小Y一道数学题.题目如下:      对于一个正整数N,存在一个正整数T(0<T&l ...

  8. opencv::轮廓周围绘制矩形框和圆形框

    基于RDP算法实现,目的是减少多边形轮廓点数 approxPolyDP(InputArray curve, OutputArray approxCurve, double epsilon, bool ...

  9. gitlab 提交

    gitlab 提交 Git global setup git config --global user.name "lial" git config --global user.e ...

  10. 在VM上安装OpenWrt

    1.选择'自定义',点击'下一步' 2.'硬件兼容性'默认,点击'下一步' 3.'稍后安装操作系统',点击'下一步' 4.客户机操作系统'Linux' 版本'CentOS 64位',点击'下一步' 说 ...