mysql 无法启动

错误信息

2016-07-01  9:37:56 2664 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-07-01  9:37:56 2664 [Note] InnoDB: The InnoDB memory heap is disabled
2016-07-01  9:37:56 2664 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-07-01  9:37:56 2664 [Note] InnoDB: Memory barrier is not used
2016-07-01  9:37:56 2664 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-07-01  9:37:57 2664 [Note] InnoDB: Not using CPU crc32 instructions
2016-07-01  9:37:57 2664 [Note] InnoDB: Initializing buffer pool, size = 64.0M
2016-07-01  9:37:57 2664 [Note] InnoDB: Completed initialization of buffer pool
2016-07-01  9:37:57 2664 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-01  9:37:57 2664 [Note] InnoDB: The log sequence numbers 37077739 and 37077739 in ibdata files do not match the log sequence number 37077749 in the ib_logfiles!
2016-07-01  9:37:57 2664 [Note] InnoDB: Database was not shutdown normally!
2016-07-01  9:37:57 2664 [Note] InnoDB: Starting crash recovery.
2016-07-01  9:37:57 2664 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-07-01  9:38:11 2664 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace tp5/qii_menu uses space ID: 21 at filepath: .\tp5\qii_menu.ibd. Cannot open tablespace ymtx/az_brand which uses space ID: 21 at filepath: .\ymtx\az_brand.ibd
InnoDB: Error: could not open single-table tablespace file .\ymtx\az_brand.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

看最后一句,在my.ini里面设置innodb_force_recovery>0试试

innodb_force_recovery=1

重启mysql,搞定了。

 

but,问题又来了。

insert数据,没有问题。但是update,就不行了。

1036:table xx is read only.

打开日志一看。

innodb Started in read only mode

wtf.

翻到一篇帖子:

http://stackoverflow.com/questions/25394466/my-sql-error-1015-cant-lock-file-errno-165-table-is-read-only-innodb-en

把刚才加的那句配置,删掉,重启,ok。

转载于:https://my.oschina.net/qii/blog/703910

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 可能是以下原因导致wampserver中的MySQL无法启动: 1.端口被占用:MySQL默认使用3306端口,如果该端口被其他程序占用,MySQL无法启动。可以尝试更改MySQL的端口号。 2.配置文件错误:如果MySQL的配置文件(my.ini或my.cnf)中存在错误,MySQL无法启动。可以检查配置文件中的语法错误或不正确的配置项。 3.权限问题:如果MySQL的数据目录或日志目录没有正确的权限设置,MySQL无法启动。可以尝试更改目录的权限。 4.磁盘空间不足:如果MySQL的数据目录没有足够的磁盘空间,MySQL无法启动。可以尝试清理磁盘空间或更改数据目录。 解决方法: 1.检查端口是否被占用,如果是,可以更改MySQL的端口号。 2.检查配置文件是否存在错误,可以使用MySQL的命令行工具进行检查。 3.检查目录的权限设置是否正确,可以使用chmod命令更改权限。 4.检查磁盘空间是否足够,可以使用df命令查看磁盘空间使用情况。如果磁盘空间不足,可以尝试清理磁盘空间或更改数据目录。 ### 回答2: Wampserver是一种集成式的Web开发环境,其中包括Apache Web服务器,PHP编程语言和MySQL数据库管理系统。MySQL无法启动的原因可能因网络端口号被占用,MySQL配置文件出现错误,MySQL服务未启动或出现其他未知问题。 首先,检查是否有其他应用程序正在占用MySQL所需的端口号。在MySQL配置文件my.ini中查找端口号的位置,通常是在[mysqld]部分中的“port”变量下。如果该端口被占用,尝试更改端口号或关闭正在使用该端口的应用程序。 第二个可能的原因是MySQL配置文件my.ini中的错误。检查配置文件中的语法错误,例如缺少“=”或其他符号,不能正常识别。还可以尝试下载并使用标准的、可靠的my.ini文件,或者删除当前my.ini文件并重新创建一个新的。 第三个原因可能是MySQL服务未启动。尝试手动启动MySQL服务以进行测试。在Windows操作系统上使用服务管理器和命令行,或者使用Wampserver的控制面板中的“Services”页面启动服务。 最后,如果以上步骤无效,应确保MySQL版本与Wampserver兼容,可以尝试下载并使用另一个版本的Wampserver或下载单独的MySQL安装程序。 总之,通过排查以上可能的原因,结合相关的技术知识,我们可以解决MySQL无法启动的问题,保证Wampserver平稳运行。 ### 回答3: WampServer是一款常用的Web服务器集成环境,能够方便地在Windows平台上搭建Web服务器。但有时,我们可能会面临WampServer的MySQL无法启动的情况。 造成MySQL无法启动的原因有很多,以下是一些常见的问题及其解决方案: 1. 端口冲突:如果在同一台计算机上运行了多个MySQL服务器实例,或者已经在使用默认3306端口,那么WampServer中的MySQL无法启动。解决方法是更改MySQL的端口号,可以在MySQL配置文件中修改端口号,如my.ini或my.cnf。 2. 数据库文件损坏:如果MySQL的数据文件(datadir)损坏或缺失,那么WampServer中的MySQL无法启动。解决方法是备份数据,并重新安装MySQL。 3. 配置错误:如果MySQL配置文件(my.ini或my.cnf)文件中存在错误,也可能导致MySQL无法启动。解决方法是检查并修复配置文件中的错误。 4. 兼容性问题:WampServer和操作系统的兼容性也可能导致MySQL无法启动。解决方法是更新WampServer或操作系统,并升级MySQL到最新版本。 5. 服务启动问题:WampServer的MySQL服务可能未正确启动。可以在服务管理器中查看MySQL的状态,并尝试重新启动服务。 总之,当WampServer中的MySQL无法启动,需要仔细检查所述问题,并采取适当的措施来解决问题。为了保证WampServer的正常运行和稳定性,建议经常备份和维护数据库。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值