亚马逊linux上的mysql-MySQL守护程序无法启动 [英] mysql on amazon linux - MySQL Daemon failed to start
本文介绍了亚马逊linux上的mysql-MySQL守护程序无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试重新启动EC2实例和sudo service httpd restart
.
I tried that restarting EC2 instance and sudo service httpd restart
.
但我仍然收到此消息:
[ec2-user@ip-* ~]$ sudo service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
我也收到此消息:
[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.
我不知道该怎么办.
干杯!
(+我也在使用Amazon RDS.)
(+ I'm also using amazon RDS.)
现在,我也尝试过sudo chown -R mysql:mysql /var/lib/mysql
.
但是
[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
推荐答案
我回答我自己的问题,以帮助遇到相同问题的其他人.
I answer myself to my question to help other people in the same problem.
- 重新启动您的EC2实例.
- 键入
sudo service httpd restart
. (我不知道为什么要执行这两个步骤.) - 键入
sudo chown -R mysql:mysql /var/lib/mysql
. -键入此命令之前,请检查/etc/my.cnf
中的user=
选项.如果没有user=
选项,则您的user
为"mysql". (访问 https://stackoverflow.com/a/21435052/1570534 ) - 将
/etc/my.cnf
中的innodb_buffer_pool_size
选项从128 (can be different)
更改为500M
.如果/etc/my.cnf
中没有innodb_buffer_pool_size
选项,请在[mysqld]部分中添加innodb_buffer_pool_size=500M
.
- Restart your EC2 instance.
- Type
sudo service httpd restart
. (I don't know why I should do these two steps.) - Type
sudo chown -R mysql:mysql /var/lib/mysql
. - Before typing this command, check youruser=
option in your/etc/my.cnf
. If there is nouser=
option, youruser
is "mysql". (Visit https://stackoverflow.com/a/21435052/1570534) - Change the
innodb_buffer_pool_size
option inside/etc/my.cnf
from128 (can be different)
to500M
. If you don't haveinnodb_buffer_pool_size
option in your/etc/my.cnf
, addinnodb_buffer_pool_size=500M
in [mysqld] section.
希望对您有帮助!
这篇关于亚马逊linux上的mysql-MySQL守护程序无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文