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. 像学历史课本一样学习Perl

    第一次接触Perl,还是2008年10月份的时候,当时因为项目重构,需要进行大量的文本操作,于是便拾起了以“文本操作为己任”的Perl语言.当然,带我入门的还是那本赫赫有名的The Llama  Bo ...

  2. Eclipse中Maven+Spring3.2.8+SpringMVC HelloWorld项目

    本文适合有一定spring和springmvc基础,并想使用Maven管理项目的人. 源码打包:http://pan.baidu.com/s/1hqurUcs 转载请声明出处(http://www.c ...

  3. 20160720-java高并发

    https://www.zhihu.com/search?type=content&q=tomcat+%E8%83%BD%E6%94%AF%E6%8C%81%E5%A4%9A%E5%B0%91 ...

  4. Spark工程开发前台技术实现与后台函数调用

    Spark是一个通用的大规模数据快速处理引擎.可以简单理解为Spark就是一个大数据分布式处理框架.基于内存计算的Spark的计算速度要比Hadoop的MapReduce快上50倍以上,基于磁盘的计算 ...

  5. PLSQL_闪回操作3_Fashback Transaction Query

    2014-12-09 Created By BaoXinjian

  6. BIP_开发案例04_通过BI Publisher实现打印报表的二维码(案例)(待整理)

    2014-01-01 Created BaoXinjian

  7. 如何判断TCP包是否发送成功

    1. TCP发送接口:send() TCP发送数据的接口有send,write,sendmsg.在系统内核中这些函数有一个统一的入口,即sock_sendmsg().由于TCP是可靠传输,所以对TCP ...

  8. html 其它标签

    <pre> 标签 , 如果写的内容在记事本中  在网页上原样输出 <fieldset> 外框 <p> 段落 <sub>下标 <sup> 上标 ...

  9. IT项目管理

    IT项目管理是项目管理在IT领域的应用,结合IT行业特点运用项目管理技术.理念和方法,包括9大知识领域(项目综合.范围.时间.成本.质量.人力资源.沟通.风险和采购管理)以及启动.计划.实施.控制和收 ...

  10. linux free命令(转载)

    来源:http://www.cnblogs.com/peida/archive/2012/12/25/2831814.html free命令可以显示Linux系统中空闲的.已用的物理内存及swap内存 ...