# # 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.