luozhangyou 发表于 2017-9-13 02:25:26

centos新安装mysql5.6报错了

2017-09-12 14:15:09 3442 Plugin 'FEDERATED' is disabled.
2017-09-12 14:15:09 3442 InnoDB: Using atomics to ref count buffer pool pages
2017-09-12 14:15:09 3442 InnoDB: The InnoDB memory heap is disabled
2017-09-12 14:15:09 3442 InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-09-12 14:15:09 3442 InnoDB: Memory barrier is not used
2017-09-12 14:15:09 3442 InnoDB: Compressed tables use zlib 1.2.3
2017-09-12 14:15:09 3442 InnoDB: Using Linux native AIO
2017-09-12 14:15:09 3442 InnoDB: Not using CPU crc32 instructions
2017-09-12 14:15:09 3442 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(136019968 bytes) failed; errno 12
2017-09-12 14:15:09 3442 InnoDB: Cannot allocate memory for the buffer pool
2017-09-12 14:15:09 3442 Plugin 'InnoDB' init function returned error.
2017-09-12 14:15:09 3442 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-09-12 14:15:09 3442 Unknown/unsupported storage engine: InnoDB
2017-09-12 14:15:09 3442 Aborting


解决办法:

查看内存
$ free
             total       used       free   shared    buffers   cached
Mem:      608476   565044      43432          0       1284      53996
-/+ buffers/cache:   509764      98712
Swap:            0          0          0


好吧,明显的swap问题。适当增加swap,采用
$ sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 #增加1G的SWAP进去
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ free
             total       used       free   shared    buffers   cached
Mem:      608476   601432       7044          0      824      88752
-/+ buffers/cache:   511856      96620
Swap:      1048572          0    1048572

此处不建议将swapon 写到/etc/fstab这里,直接写到/etc.rc.local中更为稳妥启动解决...
页: [1]
查看完整版本: centos新安装mysql5.6报错了