A method to solve the mariadb abnormal termination under CentOS 7.0 x64

Source: Internet
Author: User
Tags centos

# # SSH connection used to connect the past first, and then enter:

sudo systemctl status mariadb.service Linux learning, http://linux.it.net.cn
# # This time you can see some error tips:

140819 14:06:14 mysqld_safe Logging to '/var/log/mariadb/mariadb.log '.
140819 14:06:14 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql

As you can see here, log is stored in/var/log/mariadb/mariadb.log, and then we go on to look at the problem: Linux learning, http://linux.it.net.cn

sudo nano/var/log/mariadb/mariadb.log


And then you can see that the more important problem is that it appears in the following sentence:

140819 14:06:14 innodb:fatal Error:cannot Allocate memory for the buffer pool


The problem here is quite clear, there is not enough memory to allocate resources.

# # The feasible solution is about three kinds:
1. Increase the physical memory, using the DG Server, so you can upgrade the configuration directly.

2. Create a swap partition, which should be a better solution, using the following commands:

# # Use root permission, direct Sudo-i Bar
DD If=/dev/zero Of=/swap.dat bs=1024 count=524288
# # 524288=512*1024 that is to say, 512M swap partitions are allocated
Mkswap/swap.dat
Swapon/swap.dat
# # then look at the effect
Free-m
# # will appear below, which means it's been successful.
Total used free shared buffers Cached
mem:490 453 37 1 1 22
-/+ buffers/cache:430 60
SWAP:511 48 463
# # This is not enough, we need to continue to let the system mount the swap automatically, edit/etc/fstab and add a row:
/swap.dat Swap 0 0
Linux Learning, http://linux.it.net.cn
Now basically has solved the problem, the direct start mariadb should be no problem:

sudo systemctl start Mariadb.service
3. Modify the MySQL memory pool size, edit/etc/my.cnf and modify the following:

[Mysqld]
innodb_buffer_pool_size=64m

# # finally open the site, you should be able to see the content.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.