问题描述:
从网上下了5.7 的MySQL,在bin目录下执行 start mysqld ,弹出个cmd窗口一闪就没了,也看不清是什么报错。mysqld --install安装了服务,也启动不了。
处理步骤:
1、打开事件查看器检查报错信息
2、网上查了,都说如果是 linux 需要执行 mysql_install_db;如果是Windows需要拷贝 user.frm user.MYD和user.MYI
3、不过,http://serverfault.com/questions/291126/mysql-fatal-error-cant-open-and-lock-privilege-tables-table-mysql-host-doe
这里面有人建议使用 mysqld --initialize
执行了下,报错:
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqld --initialize
2016-12-20T04:33:22.298853Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is
deprecated. Please use --explicit_defaults_for_timestamp server option (see doc
umentation for more details).
2016-12-20T04:33:22.298853Z 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.
2016-12-20T04:33:22.298853Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not s
et.
2016-12-20T04:33:22.303853Z 0 [ERROR] --initialize specified but the data direct
ory has files in it. Aborting.
2016-12-20T04:33:22.304853Z 0 [ERROR] Aborting
4、因为都是测试数据,我就直接把 datadir (我的是D:\MysqlData) 文件夹给删了。再次执行mysqld --initialize
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqld --initialize
5、启动服务(如果没有安装服务的话需要先 执行 mysqld --install)
C:\Program Files\MySQL\MySQL Server 5.7\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
这种方法比起拷贝 user. 文件的要简单,不过需要清除所有数据,适合在自己的测试环境上使用。
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- [ABC]安娜-胆麦发烧女声[6N纯银镀膜][2016[低速原抓WAV+CUE]
- 任天堂今晚举行直面会!第三方及独立游戏展示
- 《哆啦A梦的铜锣烧店物语》发售!开罗公式+哆啦A梦
- 任天堂公布《塞尔达传说》系列时间线:野炊与王泪独立在外
- 五条人.2012-一些风景2CD【刀马旦】【WAV+CUE】
- 陈奕迅.2013-Easons.Life演唱会2CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 许美静.1995-遗憾(新马版)【上华】【WAV+CUE】
- 《叶倩文 歌声情缘》[WAV+CUE][410MB]
- 《张国荣 首首动听经典不容错过 追忆的风 2CD》[WAV+CUE][870MB]
- 《腾格尔 容中尔甲 亚东 高原三星 男人篇 3CD》[WAV/分轨][1GB]
- 命运圣契公测实测可用兑换码大全 命运圣契最新兑换码分享
- 黑神话悟空上品疾蝠精魄获取方法一览|上品疾蝠精魄收集攻略
- 《七龙珠电光炸裂!ZERO》GT角色预告片曝光,15位新角色登场
- [ABC]安娜-胆麦发烧女声[6N纯银镀膜][2016[低速原抓WAV+CUE]
- NewViennaOctetViennaWindSoloists-TheDeccaRecordings(2024)18CD[24-48][FLAC]-7