转载请注明出处http://www.cnblogs.com/havedream/p/5075263.html

重装系统之后准备安装mysql,看到官网上有mysql 5.7.10可以下载就点了,然后就开始了漫长的安装路程,总共折腾差不多一个多小时,最后终于安装成功了,这里把安装过程写下来,给自己做个笔记,也给后来人一个安装提示.

  1.下载安装包

  直接点击或者复制之后就可以下载了,不嫌麻烦或者想体验其他版本的也可以去官网下载,但是请注意,笔记只在5.7.10这个版本下运行成功,其他版本(仅供参考)需要参考官方的安装文档!

  http://120.192.95.132/cache/dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.10-winx64.zip?ich_args=33a24030fa5191a36f50adaf2a0329c5_1_0_0_5_9c71accd314cb3f9f9f6e66f07ef13e42dd4f7c2bf4ea27f34b88c04e33f0945_80de45f03e1c6ffbe40617244bdec41b_1_0&ich_ip=

  2.解压缩文件夹到本地磁盘

  我把文件放在了

C:\Program_Files\mysql-5.7.-winx64

  3.复制my-default.ini为my.ini

建议复制一份,或者直接把my-default.ini重命名为my.ini

  4.填写my.ini相关内容

basedir=C:\Program_Files\mysql-5.7.-winx64
datadir=C:\Program_Files\mysql-5.7.-winx64\data
port=

路径请替换成自己实际路径!

  5.环境变量

新增环境变量,如下图

修改path,注意是修改,增加的是后面我选中的部分

%MYSQL_HOME%\bin;

  6.管理员权限运行[命令提示符]

尽量使用管理员权限运行,否则,可能出现无法安装或者无法启动服务等问题!

  7.执行mysql初始化data

mysqld --initialize --console

结果如下:

C:\Windows\system32>mysqld --initialize --console
--25T03::.140732Z [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
--25T03::.140732Z [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
--25T03::.140732Z [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
--25T03::.614085Z [Warning] InnoDB: New log files created, LSN=
--25T03::.775606Z [Warning] InnoDB: Creating foreign key constraint system tables.
--25T03::.872089Z [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ceb98c90-aab3-11e5-8ca7-b870f4733564.
--25T03::.872089Z [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
--25T03::.891376Z [Note] A temporary password is generated for root@localhost: +>><=Gs,0spF

请注意,最后一句包含我们所需要的初始化密码!!!!

  8.安装mysql服务,并启动

C:\Windows\system32>mysqld -install
Service successfully installed. C:\Windows\system32>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

  9.登录mysql并修改密码

请注意,我下面的密码和上面的那个初始化密码不一样了,因为我有重新卸载了服务然后重新执行了一遍 7和8 ,因为上面的密码提示我无法登录,"<"无法识别!!!不知道有没有人知道是为什么?难道随机的密码太随机了?

C:\Windows\system32>mysql -uroot -pih.sQWazK9*
mysql>  set password for 'root'@'localhost'="你的密码";
Query OK, rows affected (0.00 sec)

好了,现在退出

mysql> exit
Bye

  10.修改远程登录

到上面9 的时候本机已经可以正常使用mysql的功能了,不过如果需要远程登录mysql的话需要下面的设置

C:\Windows\system32>mysql -uroot -p你的密码
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use mysql
Database changed
mysql> select host,user from user;
+-----------+-----------+
| host | user |
+-----------+-----------+
| localhost | mysql.sys |
| localhost | root |
+-----------+-----------+
rows in set (0.00 sec) mysql> update user set host='%' where user = 'root';
Query OK, row affected (0.00 sec)
Rows matched: Changed: Warnings: mysql> select host,user from user;
+-----------+-----------+
| host | user |
+-----------+-----------+
| % | root |
| localhost | mysql.sys |
+-----------+-----------+
rows in set (0.00 sec) mysql>

好了,到这里全部完成了,开始你的mysql之旅吧!

转载请注明出处http://www.cnblogs.com/havedream/p/5075263.html

mysql 5.7压缩包安装笔记的更多相关文章

  1. mysql 5.7 压缩包安装教程

    前言 :  避免之前装的MySQL影响 首先进入dos窗口执行 sc delete mysql      删除已有的mysql服务 (一) 下载MySQL5.7 版本压缩包 网址 https://de ...

  2. MySQL Infobright 数据仓库快速安装笔记[转]

    [文章作者:张宴 本文版本:v1.1 最后修改:2010.05.18 转载请注明原文链接:http://blog.zyan.cc/infobright/] Infobright是一个与MySQL集成的 ...

  3. windows下通过压缩包安装MySQL

    一.下载压缩包 二.解压缩后存放在该路径下 三.配置环境变量     将D:\Program Files\mysql-8.0.11-winx64\bin添加到用户PATH变量或系统PATH变量中   ...

  4. 简述C#中IO的应用 RabbitMQ安装笔记 一次线上问题引发的对于C#中相等判断的思考 ef和mysql使用(一) ASP.NET/MVC/Core的HTTP请求流程

    简述C#中IO的应用   在.NET Framework 中. System.IO 命名空间主要包含基于文件(和基于内存)的输入输出(I/O)服务的相关基础类库.和其他命名空间一样. System.I ...

  5. 【JAVAWEB学习笔记】26_Linux基础:简介安装、常用命令和JDK、Mysql、Tomcat的安装

    Linux基础 学习目标 1.了解Linux的简介与安装 2.掌握Linux常用的命令 3.掌握Linux系统上JDK.Mysql.Tomcat的安装 一.Linux的简介 1.Linux的概述 Li ...

  6. mysql 安装(压缩包安装和exe安装)

    1:mysql官网:https://dev.mysql.com/downloads/file/?id=482487 2:压缩包安装:https://www.cnblogs.com/jamespan23 ...

  7. Windows下压缩包安装Mysql

    1. 下载mysql压缩包 2. 解压到指定目录,例如D:\Program Files\mysql-5.7.25-winx64 3. 在目录下创建配置文件my.ini [mysqld] port = ...

  8. mysql安装笔记

    MySQL-mysql 8.0.11安装教程 - Laumians - 博客园  https://www.cnblogs.com/laumians-notes/p/9069498.html mysql ...

  9. Dubbo入门到精通学习笔记(十九):MySQL源码编译安装、MySQL主从复制的配置

    文章目录 MySQL 源码编译安装(CentOS-6.6+MySQL-5.6) 一.服务器配置: 二.源码安装 MySQL5.6.26: MySQL主从复制的配置 环境 依赖课程 MySQL 主从复制 ...

随机推荐

  1. c# as

    as:用于检查在兼容的引用类型之间执行某些类型的转换. Employee myEmployee = myObject as Employee; if (myEmployee != null) { } ...

  2. C++学习42 输入和输出的概念

    我们经常用到的输入和输出,都是以终端为对象的,即从键盘输入数据,运行结果输出到显示器屏幕上.从操作系统的角度看,每一个与主机相连的输入输出设备都被看作一个文件.除了以终端为对象进行输入和输出外,还经常 ...

  3. C++学习22 多态的概念及前提条件

    在<C++基类和派生类的赋值>一节中讲到,基类的指针也可以指向派生类对象.请看下面的例子: #include <iostream> using namespace std; c ...

  4. C语言实现词频统计——第二版

    原需求 1.读取文件,文件内包可含英文字符,及常见标点,空格级换行符. 2.统计英文单词在本文件的出现次数 3.将统计结果排序 4.显示排序结果 新需求: 1.小文件输入. 为表明程序能跑 2.支持命 ...

  5. Mingyang.net:为什么不将Bean定义在Action参数中?

    Spring MVC提供了一种方便的Bean填充方式: @Controller public class CmsChannelController extends AbstractController ...

  6. POJ 2396 Budget【网络流】

    题意: cas           //测试数据组数 n m         //行数 列数 a1 a2 ... an    //每行的和 b1 b2 ... bn   //每列的和 q       ...

  7. Django网站直接使用supervisor部署

    python manage.py createsuperuser python manage.py migrate 生成网站的supervisor配置文件: echo_supervisord_conf ...

  8. 清理SQL Server服务器名称列表

    SQL2008: C:\Users\TQ\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin SQ ...

  9. Skill

    Skill Yasser is an Egyptian coach; he will be organizing a training camp in Jordan. At the end of ca ...

  10. SQL Server int类型值最大2147483647(2^31 - 1)

    突发奇想,一个字增字段,假设每天增加1000条记录,多少年之后写不进int类型的字段了2147483647 / 1000 / 365 = 5883.51684109589041095890410958 ...