Reputation: 10055
I don't know what process is killing it. I have zero experience in CentOS. First it was not starting using
service mysqld start
And showing error
/usr/bin/mysqld_safe: line 183: 7618 Killed nohup /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock < /dev/null > /dev/null 2>&1
/usr/bin/mysqld_safe: line 183: 7675 Killed nohup /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock < /dev/null > /dev/null 2>&1 > /dev/null 2>&1
So I read somewhere to run the following command
sudo service httpd restart
Then mysqld starts normally, but within 10-15 seconds it again shows the error mentioned above. I think some process is killing it forcibly.
Here is mysqld.log
Version: '5.6.38' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2017-11-14 12:02:07 1535 [Note] Plugin 'FEDERATED' is disabled.
2017-11-14 12:02:07 1535 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-11-14 12:02:07 1535 [Note] InnoDB: The InnoDB memory heap is disabled
2017-11-14 12:02:07 1535 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-11-14 12:02:07 1535 [Note] InnoDB: Memory barrier is not used
2017-11-14 12:02:07 1535 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-11-14 12:02:07 1535 [Note] InnoDB: Using Linux native AIO
2017-11-14 12:02:07 1535 [Note] InnoDB: Using CPU crc32 instructions
2017-11-14 12:02:07 1535 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-11-14 12:02:07 1535 [Note] InnoDB: Completed initialization of buffer pool
And command free -m
showing the output below in case it is helpful.
total used free shared buffers cached
Mem: 512 280 231 128 0 7
-/+ buffers/cache: 272 239
Swap: 256 207 48
Below is my my.cnf
file.
[mysqld]
bind_address = 0.0.0.0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
thread_cache_size=4
join_buffer_size=4M
sort_buffer_size=4M
read_buffer_size=4M
read_rnd_buffer_size=6M
myisam_sort_buffer_size=64M
key_buffer_size=128M
tmp_table_size=128M
max_heap_table_size=128M
query_cache_size=256M
query_cache_type=1
default-storage-engine=myisam
#skip-innodb
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
What can be the cause of that error and killing of mysqld and How can I resolve this?
Upvotes: 3
Views: 3492
Reputation: 10055
Finally, I found that the problem was the lack of physical main memory.
Increasing the main memory fixed my issue.
Upvotes: 2