--------------------------------------------------------------------------

1. 将配置文件my.ini配置好,放到c:/windows目录下 (echo %windir%),然后执行安装mysql默认数据库的操作:

D:\tools\mysql-5.7.9-winx64\bin>mysqld --initialize-insecure --user=mysql

2. 将mysql安装成windows中的服务:

D:\tools\mysql-5.7.9-winx64\bin>mysqld install
Service successfully installed.

3. 然后在services.msc中启动mysql服务。

4.允许root访问,并且设置了root在192.168.0.101访问过来的密码,并且赋予root授予其他用户权限的权利。(权限传递 使用这个子句时将允许用户将其权限分配给他人)
mysql> grant all on *.* to "root"@"192.168.0.101" identified by "root"  WITH GRA
NT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

5. 官方的windows安装文档:
http://dev.mysql.com/doc/refman/5.7/en/windows-troubleshooting.html  Troubleshooting a Microsoft Windows MySQL Server Installation
Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
http://dba.stackexchange.com/questions/24403/change-existing-datadir-path

###-------------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]

default-character-set=utf8

[mysqld]

port=3306

basedir  ="D:/tools/mysql-5.7.9-winx64"

datadir  ="D:/tools/mysql-5.7.9-winx64/data"

tmpdir   ="D:/tools/mysql-5.7.9-winx64/data"

socket   ="D:/tools/mysql-5.7.9-winx64/mysql.sock"

log-error="D:/tools/mysql-5.7.9-winx64/data/mysql_error.log"

#server_id = 2

#skip-locking

max_connections=100

table_open_cache=256

query_cache_size=1M

tmp_table_size=32M

thread_cache_size=8

default-storage-engine=MYISAM
innodb_data_home_dir="D:/tools/mysql-5.7.9-winx64/data/"

innodb_flush_log_at_trx_commit =1

innodb_log_buffer_size=128M

innodb_buffer_pool_size=128M

innodb_log_file_size=10M

innodb_thread_concurrency=16

innodb-autoextend-increment=1000

join_buffer_size = 128M

sort_buffer_size = 32M

read_rnd_buffer_size = 32M

max_allowed_packet = 32M

explicit_defaults_for_timestamp=true

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

####################配置文件结束###################

########D:\tools\mysql-5.7.9-winx64\bin>mysqld  --defaults-file="D:\tools\mysql-5.7.9-winx64\my.ini" --console --skip-grant-tables#####################
###-------------my.ini end----------------------######

附:安装过程中的日志、操作信息(备忘)

mysqld install MySQL --defaults-file="D:/tools/mysql-5.7.9-winx64/my.ini"

D:\tools\mysql-5.7.9-winx64\bin>mysqld  --defaults-file="D:\tools\mysql-5.7.9-winx64\my.ini" --console --skip-grant-tables

UPDATE user SET Password=PASSWORD("root") where USER="root";

mysql> UPDATE user SET Password=PASSWORD("root") where USER="root";
ERROR 1046 (3D000): No database selected
mysql> use information_schema;
Database changed
mysql> UPDATE user SET Password=PASSWORD("root") where USER="root";
ERROR 1109 (42S02): Unknown table 'user' in information_schema
mysql>

mysqladmin shutdown

http://dba.stackexchange.com/questions/24403/change-existing-datadir-path

http://www.cnblogs.com/lundy/archive/2010/05/07/1729510.html  https://bugs.mysql.com/bug.php?id=65413  Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

http://dev.mysql.com/doc/refman/5.7/en/windows-troubleshooting.html  Troubleshooting a Microsoft Windows MySQL Server Installation

D:\tools\mysql-5.7.9-winx64\bin>mysqld --initialize-insecure --user=mysql
2015-11-12T15:34:20.701016Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'E
RROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will
be merged with strict mode in a future release.
2015-11-12T15:34:20.701016Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not s
et.
2015-11-12T15:34:20.709016Z 0 [ERROR] --initialize specified but the data direct
ory has files in it. Aborting.
2015-11-12T15:34:20.710016Z 0 [ERROR] Aborting

win7 安装mysql 5.7.9记录的更多相关文章

  1. win7安装mysql

    转:http://blog.csdn.net/longyuhome/article/details/7913375 Win7系统安装MySQL5.5.21图解 大家都知道MySQL是一款中.小型关系型 ...

  2. Win7安装mysql数据库、修改默认密码

    学习和使用myslq数据库半年时间,mysql对于每一个开发人员都不会陌生.今天对电脑重装系统,为了方面测试在个人PC上安装了mysql数据库.以一下是整个安装过程. 一.下载mysql 1.首先需要 ...

  3. RedHat 6 安装 MySQL 5.5 流程记录及相关问题解决方案

    目录 1. RedHat 中 使用 yum 方式安装 MySQL 2. 安装过程中遇到的问题 1. RedHat 中 使用 yum 方式安装 MySQL 1.1 删除系统自带的 MySQL 5.1 r ...

  4. Win7安装 Mysql 5.7.22客户端

    根据自己的操作系统下载对应的32位或64位的压缩包: http://dev.mysql.com/downloads/mysql/ 官网下载 选择Windows对应的版本下载 不注册直接下载 安装步骤 ...

  5. 16.Ubuntu安装mysql及win7安装mysql

    Ubuntu: 链接地址:https://www.cnblogs.com/logaa/p/6791819.html win7: 链接地址:https://jingyan.baidu.com/artic ...

  6. win7安装mysql数据库

    1. 软件准备,以64位系统为例如果是32位的下载32位压缩包即可] https://dev.mysql.com/downloads/mysql/ 2.下载解压到本地,将解压路径的bin目录配置到环境 ...

  7. win7安装mysql解压缩版

    http://blog.csdn.net/u013067166/article/details/49951577

  8. ubuntu安装mysql自动输入密码随笔记录

    sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password your_pass ...

  9. win7下解压安装mysql的方法

    在win7下通过解压安装mysql 5.7一直出现启动不成功,网上找了好久终于找到一个解决方法,记录一下: 1.解压下载的压缩包 2.在解压目录下,将my-default.ini改名为my.ini, ...

随机推荐

  1. vue循环中的v-show

    v-show如果使用循环对象的属性来时控制, 这个属性必须是加载时就存在的 <div class="list-group col-sm-12" v-for="(is ...

  2. 使用迭代器遍历List的时候修改List报ConcurrentModificationException异常原因分析

    在使用Iterator来迭代遍历List的时候如果修改该List对象,则会报java.util.ConcurrentModificationException异常,下面看一个例子演示: package ...

  3. hibernate调用mysql存储过程

    在mysql中创建两个存储过程,如下: 1.根据id查找某条数据: )) begin select * from emp where empId=id; end; 2.根据id查找某个字段,并返回 ) ...

  4. springMVC加载远程freemarker模板文件

    在一个大网站里,有很多子域名,也就是有很多子系统,这些子系统由不同的团队负责,对整个网站的风格的风格至少得要是一致的(最基本的页头.页尾必须一致),这个时候得提供一份统一的页头.页尾以及公共的JS.c ...

  5. 洛谷 P1736 创意吃鱼法

    题目描述 题目链接:https://www.luogu.org/problemnew/show/P1736 回到家中的猫猫把三桶鱼全部转移到了她那长方形大池子中,然后开始思考:到底要以何种方法吃鱼呢( ...

  6. codevs 1576 最长严格上升子序列

    题目链接:http://codevs.cn/problem/1576/ 题目描述 Description 给一个数组a1, a2 ... an,找到最长的上升降子序列ab1<ab2< .. ...

  7. 关于UDP-读这篇就够了(疑难杂症和使用)

    本文为转载文章 原文链接:https://www.qcloud.com/community/article/848077001486437077 版权归原文所有 关于UDP 面向报文的传输方式决定了U ...

  8. 1A2B猜数字

    知乎链接 维基百科 问题描述 又名猜数字. 一方准备从0到9十个数字里抽出4个数,随机排列,另一方同样以这样的方法回应四个数.位置相同数字相同为A,数字出现,位置不同为B,然后计数. 例1234 56 ...

  9. 我的学习工作经历,一个园林专业中专毕业生的IT之路 学习编程 创业

    我的学习工作经历,一个园林专业中专毕业生的IT之路 魏琼东,男,1983年生人,祖籍甘肃陇南人,首先得感谢我父亲给我取了这么一个好名字,至少我非常喜欢他,因为目前还没有发现和我同名的人. 我是1998 ...

  10. XSS安全处理

    Security.class.php文件 <?php class Security { public $filename_bad_chars = array( '../', '<!--', ...