MySQL5.7不能启动

wxgfd 2016-10-25 09:00:32
最近自己安装了一个MySQL5.7,刚安装好后可以运行,没有任何问题,可以关闭也可以启动。
然后自己用360清除垃圾,如下:

只要把系统文件清除了,MySQL立即关闭。
再重启也不能打开:

,然后在cmd窗口中运行mysqld --console
发现错误如下:

从错误结果中,自己知道缺少data文件夹。
我在网上查了一下资料,有用mysqld --initialize或mysql--initialize-insecure或mysqld --initialize-insecure --user=mysql来配置data文件的,我下载的是MySL5.7安装版的,在安装的过程中已经注册一个账户和密码了。如果自己需要建立data文件夹,那么用上面那种方法,还需不需要配置my-default.ini文件。自己主要是想不懂为什么清除了系统缓存后,MySQL服务器就立即停止。还请各位大神帮我看一看,尽量详细一点,小弟现行谢过。
...全文
461 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wxgfd 2016-10-27
  • 打赏
  • 举报
回复
自己刚刚用jmysqld --initial-insecure
也配置了mydefault.ini文件,并将其重命名为my.ini
然后在安装目录下也没有data文件夹
错误日志:
2016-10-26T16:45:51.561661Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-10-26T16:45:51.561661Z 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-10-26T16:45:51.561661Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2016-10-26T16:45:55.405583Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-10-26T16:45:56.389972Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-10-26T16:45:57.249306Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: aafe90d1-9b9b-11e6-bbfb-bc8556c5e368.
2016-10-26T16:45:57.452434Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-10-26T16:45:57.483710Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
wxgfd 2016-10-27
  • 打赏
  • 举报
回复
引用 4 楼 zhangsheng_1992的回复:
手动创建data文件夹 保证mysql对目录有权限即可
自己刚刚用jmysqld --initial-insecure<br /> 也配置了mydefault.ini文件,并将其重命名为my.ini<br /> 然后在安装目录下也没有data文件夹<br /> 错误日志:<br /> 2016-10-26T16:45:51.561661Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).<br /> 2016-10-26T16:45:51.561661Z 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.<br /> 2016-10-26T16:45:51.561661Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.<br /> 2016-10-26T16:45:55.405583Z 0 [Warning] InnoDB: New log files created, LSN=45790<br /> 2016-10-26T16:45:56.389972Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.<br /> 2016-10-26T16:45:57.249306Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: aafe90d1-9b9b-11e6-bbfb-bc8556c5e368.<br /> 2016-10-26T16:45:57.452434Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.<br /> 2016-10-26T16:45:57.483710Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
wxgfd 2016-10-26
  • 打赏
  • 举报
回复
在我的MySQL数据存放目录下有my.ini和data文件,请问这两个文件和MySQL安装目录下缺乏的data目录有啥区别?
zhangsheng_1992 2016-10-26
  • 打赏
  • 举报
回复
手动创建data文件夹 保证mysql对目录有权限即可
benluobo 2016-10-26
  • 打赏
  • 举报
回复
文件被删除了
rucypli 2016-10-26
  • 打赏
  • 举报
回复
应该是360删除了data目录了吧
致命的西瓜 2016-10-26
  • 打赏
  • 举报
回复
手动创建一个data目录

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧