Mysql-5.7.10在免安装后启动服务失败。

查看日志得到如下:

2016-02-19T03:41:05.557095Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-02-19T03:41:05.557095Z 0 [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.
2016-02-19T03:41:05.557095Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2016-02-19T03:41:05.557095Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2016-02-19T03:41:05.557095Z 0 [Note] C:\MySql\mysql-5.7.10-winx64\bin\mysqld (mysqld 5.7.10) starting as process 7164 ...
2016-02-19T03:41:05.573096Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-02-19T03:41:05.574096Z 0 [Note] InnoDB: Uses event mutexes
2016-02-19T03:41:05.574096Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2016-02-19T03:41:05.575096Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-19T03:41:05.576096Z 0 [Note] InnoDB: Number of pools: 1
2016-02-19T03:41:05.576096Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-19T03:41:05.620099Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-02-19T03:41:05.632099Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-02-19T03:41:05.712104Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-02-19T03:41:05.814110Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-02-19T03:41:05.815110Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-02-19T03:41:05.857112Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2016-02-19T03:41:05.859112Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-02-19T03:41:05.860112Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-02-19T03:41:05.862113Z 0 [Note] InnoDB: 5.7.10 started; log sequence number 1210198
2016-02-19T03:41:05.863113Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\MySql\mysql-5.7.10-winx64\data\ib_buffer_pool
2016-02-19T03:41:05.864113Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-02-19T03:41:05.864113Z 0 [Note] InnoDB: not started
mysqld: Table 'mysql.plugin' doesn't exist
2016-02-19T03:41:05.865113Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2016-02-19T03:41:05.866113Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160219 11:41:05
2016-02-19T03:41:05.866113Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-02-19T03:41:05.867113Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-02-19T03:41:05.868113Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2016-02-19T03:41:05.870113Z 0 [Note] IPv6 is available.
2016-02-19T03:41:05.871113Z 0 [Note] - '::' resolves to '::';
2016-02-19T03:41:05.871113Z 0 [Note] Server socket created on IP: '::'.
2016-02-19T03:41:05.873113Z 0 [Warning] Failed to open optimizer cost constant tables 2016-02-19T03:41:05.874113Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2016-02-19T03:41:05.875113Z 0 [ERROR] Aborting 2016-02-19T03:41:05.875113Z 0 [Note] Binlog end
2016-02-19T03:41:05.875113Z 0 [Note] Shutting down plugin 'ngram'
2016-02-19T03:41:05.876113Z 0 [Note] Shutting down plugin 'partition'
2016-02-19T03:41:05.876113Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-02-19T03:41:05.876113Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-02-19T03:41:05.877113Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-02-19T03:41:05.877113Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-02-19T03:41:05.877113Z 0 [Note] Shutting down plugin 'MyISAM'
2016-02-19T03:41:05.878113Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-02-19T03:41:05.878113Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-02-19T03:41:05.879114Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-02-19T03:41:05.879114Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-02-19T03:41:05.879114Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-02-19T03:41:05.880114Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-02-19T03:41:05.880114Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-02-19T03:41:05.881114Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-02-19T03:41:05.881114Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-02-19T03:41:05.881114Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-02-19T03:41:05.882114Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-02-19T03:41:05.882114Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-02-19T03:41:05.883114Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-02-19T03:41:05.883114Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-02-19T03:41:05.883114Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-02-19T03:41:05.884114Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-02-19T03:41:05.884114Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-02-19T03:41:05.885114Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-02-19T03:41:05.885114Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-02-19T03:41:05.886114Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-02-19T03:41:05.886114Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-02-19T03:41:05.886114Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-02-19T03:41:05.887114Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-02-19T03:41:05.887114Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-02-19T03:41:05.888114Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-02-19T03:41:05.888114Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-02-19T03:41:05.888114Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-02-19T03:41:05.889114Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-02-19T03:41:05.889114Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-02-19T03:41:05.889114Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-02-19T03:41:05.890114Z 0 [Note] Shutting down plugin 'InnoDB'
2016-02-19T03:41:05.890114Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-02-19T03:41:05.890114Z 0 [Note] InnoDB: Starting shutdown...
2016-02-19T03:41:05.991120Z 0 [Note] InnoDB: Dumping buffer pool(s) to C:\MySql\mysql-5.7.10-winx64\data\ib_buffer_pool
2016-02-19T03:41:05.993120Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160219 11:41:05
2016-02-19T03:41:07.311195Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1210217
2016-02-19T03:41:07.312196Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-02-19T03:41:07.314196Z 0 [Note] Shutting down plugin 'MEMORY'
2016-02-19T03:41:07.314196Z 0 [Note] Shutting down plugin 'CSV'
2016-02-19T03:41:07.315196Z 0 [Note] Shutting down plugin 'sha256_password'
2016-02-19T03:41:07.316196Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-02-19T03:41:07.316196Z 0 [Note] Shutting down plugin 'binlog'
2016-02-19T03:41:07.317196Z 0 [Note] C:\MySql\mysql-5.7.10-winx64\bin\mysqld: Shutdown complete

网上看了多信息仍未解决,最终去官网上找到了原因,原来data目录是我手工创建的,还必须执行如下命令进行初始化。

http://dev.mysql.com/doc/refman/5.7/en/windows-extract-archive.html

http://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html

To initialize the data directory, invoke mysqld with the --initialize or --initialize-insecure option, depending on whether you want the server to generate a random initial password for the 'root'@'localhost' account.

On Windows, use one of these commands:

C:\> bin\mysqld --initialize
C:\> bin\mysqld --initialize-insecure 这个命令会创建空密码的 root@localhost 账号,否则会创建带密码的 root@localhost 账号,密码直接写在 log-error 日志文件中

执行完这命令,

再执行 mysqld install MySQL --defaults-file="D:\Program Files\MySQL\mysql-5.6.13-win32\my.ini"

果然mysql服务就正常启动了。

记录下安装步骤:

添加环境变量

变量名:MYSQL_HOME

变量值:D:\Program Files\mysql-5.6.14-winx64

即为mysql的自定义解压目录。

再在Path中添加  %MYSQL_HOME%\bin

添加为服务:

从控制台进入到MySQL解压目录下的 bin 目录下:

bin\mysqld --initialize-insecure
输入服务安装命令:
mysqld install MySQL --defaults-file="D:\Program Files\MySQL\mysql-5.6.13-win32\my.ini"
#解压目录下修改的my.ini文件
安装成功后会提示服务安装成功。
#注:my.ini文件放在MySQL解压后的根目录下
#移除服务命令为:mysqld remove

附上myini文件:

  [client]
port=3306
default-character-set=utf8
[mysqld]
port=3306
character_set_server=utf8
#解压目录
basedir=C:\MySql\mysql-5.7.10-winx64
#解压目录下data目录
datadir=C:\MySql\mysql-5.7.10-winx64\data
#没有这行在5.7中要这行,否则初始化时会有警告: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see doc umentation for more details).
explicit_defaults_for_timestamp=true
[WinMySQLAdmin]
C:\MySql\mysql-5.7.10-winx64\bin\mysqld.exe

Mysql-5.7.10启动失败 。的更多相关文章

  1. mysql 5.7.10 启动多实例笔记

    1. 复制配置文件 cp /etc/my.cnf /etc/my3308.cnf 2. 修改配置文件 3. 创建目录, 并赋予权限 4. 初始化数据库 ---> 有报错 2018-01-03T0 ...

  2. 解决Mysql因内存不足启动失败的问题

    参考:https://www.jb51.net/article/136432.htm 一.查看内存 free -h free -m 二.解决方法: 1.增加swap交换空间解决问题: dd if=/d ...

  3. docker PXC MYSQL集群节点启动失败/节点顺序消失/只剩一个节点存在问题的解决

    转载于:https://my.oschina.net/u/4884318/blog/4908669 大牛 佩服此人 截取本人遇到的问题: "error:0407008A:rsa routin ...

  4. MySQL常见内存不足启动失败的完美解决方法

    Move to https://www.jb51.net/article/136432.htm

  5. linux中mysql连接不上,服务启动失败等问题解决

    confluence问题解决方式 1)针对confluence访问页面报500与连接失败等问题 首先我们登陆部署confluence的服器 10.15.4.115 2)重启mysql服务,发现重启失败 ...

  6. CentOS 7下MySQL服务启动失败的解决思路

    今天,启动MySQL服务器失败,如下所示: [root@spark01 ~]# /etc/init.d/mysqld start Starting mysqld (via systemctl): Jo ...

  7. win10 MySQL启动失败问题

    系统升级到win10之后,本地装的MySQL却突然不能启动,系统显示明明就有,可是总是启动失败.在这里解决一下: 解决win10  mysql服务消失,连接不上的问题,注意:以管理员身份运行DOS命令 ...

  8. mysql 启动失败

    1 mysql 启动时报:MySQL Daemon failed to start.并且启动失败 2 查看mysql log日志  less /var/log/mysqld.log 3 从两行erro ...

  9. MySQL安装过程net start mysql 启动失败 报“错误2,系统找不到文件”的解决办法

    MySQL安装过程net start mysql 启动失败 报“错误2,系统找不到文件”的解决办法 错误2,系统找不到文件. 开始...运行... regedit  注册表项: HKEY_LOCAL_ ...

随机推荐

  1. 解密 Uber 数据团队的基础数据架构优化之路

    如果你用过Uber,你一定会注意到它的操作是如此的简单.你一键叫车,随后车就来找你了,最后自动完成支付,整个过程行云流水.但是,在这简单的流程背后其实是用Hadoop和Spark这样复杂的基础大数据架 ...

  2. (MVVM) button enable 时,UI没有被刷新。

    if (!this.CanExecuteSubmitButton) { this.CanExecuteSubmitButton = true; CommandManager.InvalidateReq ...

  3. /proc/sys/net/ipv4/

    /proc/sys/net/ipv4/icmp_timeexceed_rate这个在traceroute时导致著名的"Solaris middle star".这个文件控制发送IC ...

  4. pthread_key_t和pthread_key_create()详解

    pthread_key_t和pthread_key_create()详解 下面说一下线程中特有的线程存储, Thread Specific Data .线程存储有什么用了?他是什么意思了?大家都知道, ...

  5. android 通知

    https://developer.android.com/design/patterns/notifications.html 通知系统可让用户随时了解应用中的相关和即时事件,例如来自好友的新聊天信 ...

  6. 远程调用jboss as 7上部署的ejb出现No EJB receiver available for handling 异常

    昨天倒腾了一天终于配置好了jboss as 7的域,今天又倒腾了一整天在上面部署了个EJB,然后试了一个利用JNDI来进行远程调用.下面记录一下过程中那些乱七八糟的问题: 首先是这个jboss-cli ...

  7. Javascript函数声明与函数表达式

    在定义函数时,我们一般使用下面这两种方法: 使用函数声明定义: function sum (a, b) { return a + b; } 使用函数表达式定义: var sum = function ...

  8. Guava 8-区间

    范例 List scores; Iterable belowMedian =Iterables.filter(scores,Range.lessThan(median)); ... Range val ...

  9. Redis优化经验

    内存管理优化 Redis Hash是value内部为一个HashMap,如果该Map的成员数比较少,则会采用类似一维线性的紧凑格式来存储该Map, 即省去了大量指针的内存开销,这个参数控制对应在red ...

  10. JDBC常用代码

    try { //加载驱动 Class.forName("com.mysql.jdbc.Driver"); String url="jdbc:mysql://127.0.0 ...