0

全部

我无法在 aws.ec2.instance 上启动 mysqld,请帮帮我?

我不知道为什么?

$ sudo yum install -y mysql mysql-server
$ sudo mysql_install_db
$ sudo service mysqld start
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

打击是一些文件来显示我的环境..

/etc/my.cnf

[mysqld]
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under different user or group, 
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

我的日志(/var/log/mysql.log)

120506 10:53:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120506 10:53:44 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
120506 10:53:44 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
120506 10:53:44 InnoDB: The InnoDB memory heap is disabled
120506 10:53:44 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120506 10:53:44 InnoDB: Compressed tables use zlib 1.2.3
120506 10:53:44 InnoDB: Using Linux native AIO
120506 10:53:44 InnoDB: Initializing buffer pool, size = 128.0M
120506 10:53:44 InnoDB: Completed initialization of buffer pool
120506 10:53:44 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 48941
120506 10:53:44  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 1595675
120506 10:53:44  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 
InnoDB: Apply batch completed
120506 10:53:44  InnoDB: Waiting for the background threads to start
120506 10:53:45 InnoDB: 1.1.8 started; log sequence number 1595675
120506 10:53:45 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
120506 10:53:45 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
120506 10:53:45 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

如果需要任何其他信息,请告诉我

4

2 回答 2

1

尝试查找文件 host.frm 并检查其所属的组和用户。“错误号:13”是指:

~$ perror 13
OS error code  13:  Permission denied

所以大概就是这样。如果您没有该文件(即 mysql 中的表),则必须使用以下命令重新生成它们:

~$ mysql_install_db

干杯,

马齐。

于 2012-07-05T14:06:45.407 回答
0

我在多个 AWS 服务器上多次看到这个问题,在我的案例中,主要原因是空间不足。

因此,只需释放服务器上的一些空间并重新启动您的 mysqld,它应该开始正常工作。

于 2017-10-24T13:41:21.460 回答