源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Windows下MySQL 5.7无法启动的解决方法

  • 时间:2021-12-29 12:04 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Windows下MySQL 5.7无法启动的解决方法
[b]问题描述:[/b] 从网上下了5.7 的MySQL,在bin目录下执行 start mysqld ,弹出个cmd窗口一闪就没了,也看不清是什么报错。mysqld --install安装了服务,也启动不了。 [b]处理步骤:[/b] 1、打开事件查看器检查报错信息 [img]http://files.jb51.net/file_images/article/201612/20161221110904934.png?2016112111922[/img] 2、网上查了,都说如果是 linux 需要执行 mysql_install_db;如果是Windows需要拷贝 user.frm user.MYD和user.MYI 3、不过,[url=http://serverfault.com/questions/291126/mysql-fatal-error-cant-open-and-lock-privilege-tables-table-mysql-host-doe]http://serverfault.com/questions/291126/mysql-fatal-error-cant-open-and-lock-privilege-tables-table-mysql-host-doe[/url] 这里面有人建议使用   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. 文件的要简单,不过需要清除所有数据,适合在自己的测试环境上使用。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部