Logo Questions Linux Laravel Mysql Ubuntu Git Menu

mysql on amazon linux - MySQL Daemon failed to start

I tried that restarting EC2 instance and sudo service httpd restart.

But I still get this message:

[ec2-user@ip-* ~]$ sudo service mysqld start
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

Also I get this message:

[ec2-user@ip-* ~]$ mysqld
160127  7:01:48 [Note] mysqld (mysqld 5.5.46) starting as process 2745 ...
160127  7:01:48 [Warning] Can't create test file /var/lib/mysql/ip-*.lower-test
160127  7:01:48 [Warning] Can't create test file /var/lib/mysql/ip-*.lower-test
160127  7:01:48 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160127  7:01:48 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160127  7:01:48 InnoDB: The InnoDB memory heap is disabled
160127  7:01:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160127  7:01:48 InnoDB: Compressed tables use zlib 1.2.8
160127  7:01:48 InnoDB: Using Linux native AIO
160127  7:01:48 InnoDB: Initializing buffer pool, size = 128.0M
160127  7:01:48 InnoDB: Completed initialization of buffer pool
160127  7:01:48  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

I don't know what should I do..



(+ I'm also using amazon RDS.)

Now, I tried sudo chown -R mysql:mysql /var/lib/mysql too.


[ec2-user@ip-* ~]$ mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed

[ec2-user@ip-* ~]$ ls -lh /var/lib/mysql/
합계 29M
-rw-rw---- 1 mysql mysql 5.0M  1월 27 06:52 ib_logfile0
-rw-rw---- 1 mysql mysql 5.0M  1월 27 06:12 ib_logfile1
-rw-rw---- 1 mysql mysql  18M  1월 27 06:52 ibdata1
drwx------ 2 mysql mysql 4.0K  1월 20 07:03 mysql
drwx------ 2 mysql mysql 4.0K  1월 20 07:03 performance_schema
drwx------ 2 mysql mysql 4.0K  1월 20 07:03 test
like image 738
Yonggoo Noh Avatar asked Mar 13 '23 12:03

Yonggoo Noh

1 Answers

As per today the nano instances with 0.5GiB memory do not allow running mysqld - they do not have enough memory. Running a micro instance with 1GiB memory fixes the problem completely. I think guys at AWS should have made a note about this in the LAMP installation instructions, as this research costed me several hours or even a day before I figured it out.

like image 70
Michael Zelensky Avatar answered Mar 16 '23 09:03

Michael Zelensky