网上写的不近详细,这里重新整理下。

准备:

1、windows操作系统

2、mysql 的解压版压缩文件

第一步:

解压mysql的压缩包到你的安装目录,因为是虚拟机,这里我就安装在C盘下:C:\mysql-5.7.18-win32

第二步:

配置环境变量

在系统变量下找到Path这个值,

点击编辑修改,

后面添加的路径是mysql的安装路径+\bin,比如我的安装路径是 C:\mysql-5.7.18-win32

则需要添加的是 C:\mysql-5.7.18-win32\bin

注意:添加之前看结尾有没有分号,没有记得加分号再添加。

第三步:

进入mysql安装目录下的bin文件夹,安装mysql

以管理员身份运行cmd,

依次运行下列命令:

1、cd C:\mysql-5.7.18-win32\bin                   //进入安装目录下的bin文件夹

2、mysqld --install                                    //安装mysqld服务

3、配置my.ini文件

1)需要你在安装目录下新建一个名为my.ini文件,.ini是后缀名。

2)然后在安装目录下新建一个名为data的文件夹。

如图:

把下面代码复制到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 =
default-character-set=utf8
[mysqld] # Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at % of total RAM for dedicated server, else %.
# 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 = C:\mysql-5.7.18-win32
datadir = C:\mysql-5.7.18-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

注意:

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

4、初始化mysql

同样是在mysql安装目录下的bin文件夹内,

执行下面命令:

mysqld --defaults-file=C:\mysql-5.7.18-win32\my.ini --initialize --console

运行结果如下:

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

5、启动并登录mysql

依次运行下面命令:

1)net start mysql

2)mysql -u root -p

要求你输入密码,把上面产生的随机密码输入,注意大小写。

出现红框里的内容表示的登录成功。

6、重设登录密码

运行下面命令

set password for root@localhost=password('123456');           //单引号里面是你自己的密码,可以改成你自己的密码

出现如上图界面表示成功。

7、用新密码重新登录(实验新密码对不对,这步也可以不用操作)

OK,到这里已全部完事。

Mysql 5.7 for windows 免安装版(解压版)安装和配置的更多相关文章

  1. MySql的下载和安装(解压版)

    工具/原料   windows系统 一.Mysql的下载     打开浏览器,输入mysql,点击百度搜索,得到搜索结果.   在搜索结果中,选择下面结果,因为浏览器的不同,Mysql官网在搜索结果的 ...

  2. Mysql的资源(安装版+解压版)

    Mysql的安装(安装版+解压版)! 首先有几个比较好的参考,mysql官网,菜鸟教程: (1)安装版 安装版资源,SQLyog-8.32(sn)(可视化工具), 安装过程基本和安装其它程序没有什么大 ...

  3. (一)windows下安装MongoDB解压版

    windows下安装MongoDB解压版 我安装的是(mongodb-win32-x86_64-2008plus-ssl-4.0.8.zip)版本 亲测可以使用. 连接: Windows下MongoD ...

  4. windows下tomcat zip解压版安装方法

    下面记录一下在win7(32位)系统下,安装zip解压版的方法: 一.下载zip压缩包 地址:http://tomcat.apache.org/download-80.cgi 二.解压 我把解压包解压 ...

  5. MYSQL5.6.X 非在线安装版(解压版)安装过程

    一.卸载以前旧版本(本人5.5版本) 1.关闭MySQL服务 以管理员身份运行cmd,执行以下命令: net stop mysql 或者右键我的电脑,在管理——服务——停止MySQL 2.卸载MySQ ...

  6. Windows安装PostgreSQL解压版

    PostgreSQL下载地址:https://www.enterprisedb.com/downloads/postgres-postgresql-downloads windows版,务必装在C盘! ...

  7. Windows安装MongoDB解压版

    MongoDB下载地址 https://www.mongodb.com/try/download/community 1.下载zip版本解压后,放到自定义目录,如图示 2.新建data目录用于存放数据 ...

  8. 关于MongoDB在windows下安装【解压版】

    一.首先创建数据库存储文件夹和日志文件夹,在mongodb下创建即可,找起来也方便,日志文件:mongo.log,安装出错方便查阅问题: 二.启动MongoDB服务:注意:一定要用管理员身份运行DOS ...

  9. Tomcat的三种安装方式:解压版、安装版、配置成Windows服务版

    https://blog.csdn.net/Jessica_XLF/article/details/81711429

  10. MySQL解压版安装配置

    官网下载地址:http://dev.mysql.com/downloads/windows/installer/ (可以选择解压版zip下载,也可以选择msi安装版.) 解压zip版配置: 1. 下载 ...

随机推荐

  1. 0804SHOW ENGINE INNODB STATUS

    转自http://blog.csdn.net/github_26672553/article/details/52931263 innodb存储引擎在show engine innodb status ...

  2. 一个简单的ant应用

    <pre name="code" class="html"><?xml version="1.0" encoding=&q ...

  3. configure: error: XML configuration could not be found

    运行: ./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm 之后出现 Running FastCGI Process M ...

  4. CodeForces - 344A Magnets (模拟题)

    CodeForces - 344A id=46664" style="color:blue; text-decoration:none">Magnets Time ...

  5. HDU3117-Fibonacci Numbers(矩阵高速幂+log)

    题目链接 题意:斐波那契数列,当长度大于8时.要输出前四位和后四位 思路:后四位非常easy,矩阵高速幂取模,难度在于前四位的求解.  已知斐波那契数列的通项公式:f(n) = (1 / sqrt(5 ...

  6. 11gR2 Database Services for &quot;Policy&quot; and &quot;Administrator&quot; Managed Databases (文档 ID 1481647.1)

    In this Document   Purpose   _afrLoop=1459311711568804&id=1481647.1&displayIndex=6&_afrW ...

  7. Linux中的默认权限与隐藏权限(文件、文件夹)

    一个文件(或文件夹)拥有若干个属性.包含(r/w/x)等基本属性,以及是否为文件夹(d)与文件(-)或连接文件(l)等属性.此外,Linux还能够设置其它系统安全属性.使用chattr来设置.以lsa ...

  8. Visual C++ RunTime的特征——非烫即屯

    Visual C++ RunTime的特征——非烫即屯 大一刚学C语言,第二次上机课,当我发现我照着书抄写的程序在运行之外的黑框里面跳出一排“烫烫烫烫烫”,当时就震惊了.你们能想象一个来自小城,在大学 ...

  9. iOS- &quot;unacceptable content-type: text/plain&quot;等content-type bug解决方式

    常常在使用AFN的时候会出现content-type错误,缺少请求类型,比方"unacceptable content-type: text/plain" 解决方法: 1.在网络请 ...

  10. identity in sql server 批量插入history

    https://stackoverflow.com/questions/1920558/what-is-the-difference-between-scope-identity-identity-i ...