您当前的位置: 首页 > 技术文章 > 编程语言

phpstudy中mysql启动不起来的一种情况和解决办法

作者: 时间:2023-06-21阅读数:人阅读

记录phpstudy的mysql启动不起来的一种情况及解决办法
①首先排除了端口占用
根据错误日志,发现了一些问题

情况

启动服务后的情况
在这里插入图片描述

错误日志

日志文件:phpStudy\PHPTutorial\MySQL\data\Arch.err

220504 21:24:45 [Note] Plugin 'FEDERATED' is disabled.
D:\phpStudy\PHPTutorial\MySQL\bin\mysqld.exe: Table 'mysql.plugin' doesn't exist
220504 21:24:45 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
220504 21:24:45 InnoDB: The InnoDB memory heap is disabled
220504 21:24:45 InnoDB: Mutexes and rw_locks use Windows interlocked functions
220504 21:24:45 InnoDB: Compressed tables use zlib 1.2.3
220504 21:24:45 InnoDB: Initializing buffer pool, size = 47.0M
220504 21:24:45 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
220504 21:24:45  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
220504 21:24:45  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 24 MB
InnoDB: Database physically writes the file full: wait...
220504 21:24:45  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 24 MB
InnoDB: Database physically writes the file full: wait...
220504 21:24:45  InnoDB: Operating system error number 87 in a file operation.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: File name .\ib_logfile0
InnoDB: File operation call: 'aio write'.
InnoDB: Cannot continue operation.

排查错误

错误1 硬盘扇区大小 导致的问题

220504 21:24:45  InnoDB: Operating system error number 87 in a file operation.

解决办法
打开my.ini配置文件,找到innodb_flush_method配置项,更改配置值为normal。 如果没有找到该配置项,则直接在配置文件里的[mysqld]节点增加一行新配置:

innodb_flush_method=normal

参考

错误2 缺少VC运行库

D:\phpStudy\PHPTutorial\MySQL\bin\mysqld.exe: Table 'mysql.plugin' doesn't exist
220504 21:24:45 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

我的电脑缺少了VC14运行库,所以初始化mysql不成功 排查了很久才发现的。
缺少运行库导致创建不了下面这几个数据库和文件(主要是创建不了mysql这个数据库,也就是上面错误日志中的mysql.plugin 不存在的错误)
在这里插入图片描述

启动mysql后又自动停止,并且data目录下只有这四个文件data目录解决办法:
PHPstudy要求VC9-VC14的运行库(X86和X64都建议安装)。所以需要确保已安装好VC运行库。(可以用directx修复DirectX Repair

在这里插入图片描述

当我安装好VC运行库后,
重新安装phpstudy
②在my.ini文件的[mysqld]节点下添加
innodb_flush_method=normal
③启动mysql正常运行

在这里插入图片描述

本站所有文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。

如果侵犯了你的权益请来信告知我们删除。邮箱:licqi@yunshuaiweb.com

加载中~
如果您对我们的成果表示认同并且觉得对你有所帮助可以给我们捐赠。您的帮助是对我们最大的支持和动力!
捐赠我们
扫码支持 扫码支持
扫码捐赠,你说多少就多少
2
5
10
20
50
自定义
您当前余额:元
支付宝
微信
余额

打开支付宝扫一扫,即可进行扫码捐赠哦

打开微信扫一扫,即可进行扫码捐赠哦

打开QQ钱包扫一扫,即可进行扫码捐赠哦