自学内容网 自学内容网

为mysql开启error日志 - phpstudy的数据库启动失败

步骤

  1. 找到mysql的配置文件 “my.ini”,
    windows上直接进入mysql安装目录,或者直接全盘搜;
    linux上使用命令 locate my.ini 即可搜索
     
  2. 修改"my.ini",找到 组[mysqld] 下面的“log_error=”并设置日志文件绝对路径,
    如果找不到,就在 组[mysqld] 下新增一行,例如:
    [mysqld]
    port=3306
    ...
    log_error=E:/phpStudy/Extensions/MySQL5.7.26/log/error.log
  3. 重启mysql即可 看到日志文件

后续

启动报错

2025-01-15T02:35:05.565962Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2025-01-15T02:35:05.568005Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2025-01-15T02:35:05.569630Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2025-01-15T02:35:05.895931Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2025-01-15T02:35:05.897891Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2025-01-15T02:35:05.899684Z 0 [ERROR] Failed to initialize builtin plugins.
2025-01-15T02:35:05.901453Z 0 [ERROR] Aborting

文件必须是可写入状态?

重启phpstudy即可


原文地址:https://blog.csdn.net/qq285744011/article/details/145155856

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!