I’m running an t2.micro Amazon Linux instance on EC2. I installed LAMP and WordPress on it.
I have been experiencing many unexpected mysqld shut-downs every time I left my terminal connected to my instance via ssh before going to bed/going outside. When I woke up/came back home, mysqld always shut down itself. (And I’m not sure if this is related to the self stopping issue or not.) Or is this a memory problem? (t2.micro instance provides only 1GB of memory)
And every time mysqld shuts down, the file permissions I had configured were gone, and it’s annoying to re-apply the file permissions again every time.
I just started working with these server setup stuffs, I’m still a newbie…
Could someone help me and tell me what to do to prevent future mysqld self shut-downs even if I left the terminal connection open, and how do I configure it so that I don’t have to re-apply file permissions after a shut-down?
Here is the log from mysqld:
150627 18:02:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150627 18:02:22 InnoDB: Compressed tables use zlib 1.2.7
150627 18:02:22 InnoDB: Using Linux native AIO
150627 18:02:22 InnoDB: Initializing buffer pool, size = 128.0M
150627 18:02:22 InnoDB: Completed initialization of buffer pool
150627 18:02:22 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 10566571
150627 18:02:22 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 10566581
150627 18:02:22 InnoDB: Waiting for the background threads to start
150627 18:02:23 InnoDB: 5.5.42 started; log sequence number 10566581
150627 18:02:23 Note Server hostname (bind-address): '0.0.0.0'; port: 3306
150627 18:02:23 Note - '0.0.0.0' resolves to '0.0.0.0';
150627 18:02:23 Note Server socket created on IP: '0.0.0.0'.
150627 18:02:23 Note Event Scheduler: Loaded 0 events
150627 18:02:23 Note Server socket created on IP: '0.0.0.0'.
150627 18:02:23 Note Event Scheduler: Loaded 0 events
150627 18:02:23 Note /usr/libexec/mysqld: ready for connections.
Version: '5.5.42' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Commu$
mysqld_safe Number of processes running now:
150628 18:18:29 mysqld_safe mysqld restarted
/usr/bin/mysqld_safe: line 165: /usr/bin/nohup: Cannot allocate memory
150628 18:22:53 mysqld_safe Starting mysqld daemon with databases from /var/lib$
150628 18:22:53 Note Plugin 'FEDERATED' is disabled.
150628 18:22:53 InnoDB: The InnoDB memory heap is disabled
150628 18:22:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150628 18:22:53 InnoDB: Compressed tables use zlib 1.2.7
150628 18:22:53 InnoDB: Using Linux native AIO
150628 18:22:53 InnoDB: Initializing buffer pool, size = 128.0M
150628 18:22:53 InnoDB: Completed initialization of buffer pool
150628 18:22:53 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
150628 18:22:53 InnoDB: Database was not shut down normally!
InnoDB: the log sequence number in the ib_logfiles!
150628 18:22:53 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
150628 18:22:54 InnoDB: Waiting for the background threads to start
150628 18:22:55 InnoDB: 5.5.42 started; log sequence number 11269379
150628 18:22:55 Note Server hostname (bind-address): '0.0.0.0'; port: 3306
150628 18:22:55 Note - '0.0.0.0' resolves to '0.0.0.0';
150628 18:22:55 Note Server socket created on IP: '0.0.0.0'.
150628 18:22:55 Note Event Scheduler: Loaded 0 events
150628 18:22:55 Note /usr/libexec/mysqld: ready for connections.
Version: '5.5.42' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Commu$
150628 18:28:10 mysqld_safe Number of processes running now: 0
150628 18:28:13 mysqld_safe mysqld restarted
/usr/libexec/mysqld: error while loading shared libraries: libkrb5.so.3: failed$
This is a memory problem:
You could mess around with MySQL settings to try to fix the problem, but it would be easier to just use a bigger instance type. You could also look at using the RDS free tier to host your MySQL database on a dedicated server, and get free backups into the bargain.