今天在开发时,发现程序无法链接数据库,查看数据库状态时,报错如下:
ERROR 1033 (HY000): Incorrect information in file: 'abc.frm'
在网上搜索了下,有的人说repaire table abc,尝试了没用。
有人说表结构被破坏了,需要重新建表,如果是这样,那将是一个灾难,虽然都是测试数据,但重头搞个数据库,以前的数据都没有了。
在执行show innodb status时,报错了
ERROR 1235 (42000): Cannot call SHOW INNODB STATUS because skip-innodb is defined
立即去看my.cnf里面有没有定义skip-innodb,很奇怪。
最后看到mysql的错误日志里面写着:
130829 17:20:48 [Warning] Changed limits: max_open_files: 1024 max_connections: 200 table_cache: 407
130829 17:20:48 InnoDB: Error: cannot allocate 3221241856 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 37279104 bytes. Operating system errno: 12
InnoDB: Check if you should increase the swap file or
InnoDB: ulimits of your operating system.
InnoDB: On FreeBSD check you have compiled the OS with
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...
InnoDB: Fatal error: cannot allocate the memory for the buffer pool
innodb_buffer_pool_size 1000M
重启数据库,OK啦。
以后出现问题还是记得及时看日志。