mysql 多异常 处理_MySQL异常处理汇总

mysql错误处理汇总

MySQL无法启动

MySQL启动时提示Timeout error occurred trying to start MySQL Daemon

解决办法:执行/usr/bin/mysql_install_db,修复下就OK了.

MySQL数据表无法使用

启动后发现所有的数据表都无法使用,查看MySQL异常日志,发现如下log

[root@AY1212190315567971802 sliuhuamysql]# tail /var/log/mysqld.log

InnoDB: a big enough maximum process size.

InnoDB: Note that in most 32-bit computers the process

InnoDB: memory space is limited to 2 GB or 4 GB.

InnoDB: We keep retrying the allocation for 60 seconds...

130109 12:32:19InnoDB: Fatal error: cannot allocate the memory for the buffer pool

130109 12:32:19 [ERROR] Plugin 'InnoDB' init function returned error.

130109 12:32:19 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

130109 12:32:19 [Note] Event Scheduler: Loaded 0 events

130109 12:32:19 [Note] /usr/libexec/mysqld: ready for connections.

Version: '5.1.58'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL) by Utter Ramblings

[root@AY1212190315567971802 sliuhuamysql]# tail -n 20 /var/log/mysqld.log

130109 12:31:17 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

130109 12:31:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

130109 12:31:19  InnoDB: Initializing buffer pool, size = 256.0M

130109 12:31:19  InnoDB: Error: cannot allocate 268451840 bytes of

InnoDB: memory with malloc! Total allocated memory

InnoDB: by InnoDB 7994352 bytes. Operating system errno: 12

InnoDB: Check if you should increase the swap file or

InnoDB: ulimits of your operating system.

原因:这个报错的大意是,内存基本耗尽,没有再可以分配的内存.

解决办法:查看/etc/my.cnf,找innodb_buffer_pool_size,发现设值已经超过了系统总内存,然后重新设置为系统内存1半,即innodb_buffer_pool_size = 6144M 重启MySQL就OK了.

原创文章,转载请注明: 转载自搞代码

e7ce419cf2d6ad34d01da2ceb8829eed.png

微信 赏一包辣条吧~

023a57327877fb4402bcc76911ec18ea.png

支付宝 赏一听可乐吧~

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值