I didn't expect Alibaba Cloud hosts to have no swap partition, but is it difficult to buy large memory hosts?
Mysql5.6.27 cannot run on an ECS instance of M. This problem has plagued me for a long time.
At first, no error is reported when mysql is started, but it cannot be started. After the host is restarted, an error message is reported.
The error message is a memory allocation error, as shown below:
15:18:23 1773 [Note] InnoDB: Initializing buffer pool, size = 128.0 M
InnoDB: mmap (137363456 bytes) failed; errno 12
15:18:23 1773 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
15:18:23 1773 [ERROR] Plugin 'innodb' init function returned error.
15:18:23 1773 [ERROR] Plugin 'innodb' registry as a storage engine failed.
15:18:23 1773 [ERROR] Unknown/unsupported storage engine: InnoDB
15:18:23 1773 [ERROR] Aborting
It seems that the memory is insufficient. Try to adjust innodb_buffer_pool_size = 64 M of mysql in my. cnf.
Whether innodb_buffer_pool_size is adjusted to a large value, it is Cannot allocate memory for the buffer pool.
Unexpectedly, only the last trick was to increase the virtual memory, that is, swap partition.
At first, use the free command to view the memory usage.
Free command
After frequent adjustments, it is as follows:
How to adjust it? The procedure is as follows:
# Dd if =/dev/zero of =/swap. data bs = 1 M count = 1024
# Mkswap/swap. data
# Swapon/swap. data
Now, we can configure the partition information to the fstab file to enable auto-start.
# Vi/etc/fstab
Add the following line:
/Swap. data swap defaults 0 0