MySQL常见错误

  • 介绍
本文介绍一些在使用MySQL时经常遇到错误案例以及解决办法。
  • InnoDB: Fatal error: cannot allocate memory for the buffer pool
[codesyntax lang="ini"]
160111 11:13:00 InnoDB: Initializing buffer pool, size = 512.0M
InnoDB: mmap(549453824 bytes) failed; errno 12
160111 11:13:00 InnoDB: Completed initialization of buffer pool
160111 11:13:00 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160111 11:13:00 [ERROR] Plugin 'InnoDB' init function returned error.
160111 11:13:00 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160111 11:13:00 [ERROR] Unknown/unsupported storage engine: InnoDB
160111 11:13:00 [ERROR] Aborting

160111 11:13:00 [Note] /usr/sbin/mysqld: Shutdown complete
[/codesyntax] 如果启动MySQL失败,在日志文件(/var/log/mysql/error.log)中看到有上面的错误的话,可能是因为缓存设置的过大了——一般不能超过操作系统的内存大小。修改办法如下: 找到MySQL的配置文件my.conf,然后修改mysqld节点下的如下配置(没有的话添加即可): innodb_buffer_pool_size = 64M
  • Checking for tables which need an upgrade, are corrupt or were not closed cleanly.
  • /etc/init.d/mysql: fork: Cannot allocate memory
  • ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails
在对设置有外键的表上执行delete语句时,就有可能发生这种错误。要了解这个错误的原因,首先要了解下面的内容: 在添加外键时,可以设置删除时的动作(RESTRICT、CASCADE、NO ACTION、SET NULL)。如果你设置的值为RESTRICT的话就会发生上面的错误。同样,在执行update操作时,也可以这样设置。
  • ERROR 1005 (HY000): Can't create table (errno: 150)

转载于:https://my.oschina.net/surenpi/blog/816879

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值