MAC OSX brew 升级 mysql5.6到5.7无法启动的问题

brewmysql 从5.6.22升级到了5.7, 启动mysql服务以后发现登录不进去, 原来的密码失效, 应该是两个版本的 mysql.user表结构的差异造成的, 为了保留之前的数据, 所以卸载了5.7.x. 卸载以让命令后重新指向5.6.22, 用mysql.server命令启动mysql, 这个时候报错了,启动不了:

. ERROR! The server quit without updating PID file (/usr/local/var/mysql/xxx.local.pid). 此处的 xxx是我电脑的名字,下同

这个时候先不要去搜索引擎搜索以上的错误提示,不然会找到很多不同的无效的解决方案,要定位问题还是先查看日志,避免做无用功. 我刚开始就是这么做的,浪费了不少时间.

查看日志/usr/local/var/mysql/xxx.local.err, 发现以下问题:

2016-08-03 18:18:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-03 18:18:59 81707 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2016-08-03 18:18:59 81707 [Note] Plugin 'FEDERATED' is disabled.
2016-08-03 18:18:59 81707 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-08-03 18:18:59 81707 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-03 18:18:59 81707 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-03 18:18:59 81707 [Note] InnoDB: Memory barrier is not used
2016-08-03 18:18:59 81707 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-03 18:18:59 81707 [Note] InnoDB: Using CPU crc32 instructions
2016-08-03 18:18:59 81707 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-03 18:18:59 81707 [Note] InnoDB: Completed initialization of buffer pool
2016-08-03 18:18:59 81707 [Note] InnoDB: Highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html
2016-08-03 18:18:59 81707 [ERROR] Plugin 'InnoDB' init function returned error.
2016-08-03 18:18:59 81707 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-08-03 18:18:59 81707 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-08-03 18:18:59 81707 [ERROR] Aborting

重点在:

InnoDB: to create the InnoDB data files, but log file creation failed.

通过这个关键点 google 了一下, 找到解决方法: 删除ib_logfile0ib_logfile1这两个文件,不过最好是重命名这两个文件,就算此方案无效, 还有补救的机会. 接着再启动mysql服务器, ok 了.

转载于:https://my.oschina.net/zcqshine/blog/726982

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值