2012-05-06 111 views
0

全部AWS實例上的Mysql啓動失敗

我無法在aws.ec2.instance上啓動mysqld,colude幫我嗎?

我不知道爲什麼?

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

打擊是一些文件,以顯示我的ENV ..

的/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 

如果需要任何其他信息,請告訴我請求

+1

只屬於ServerFault。您的MySQL數據文件夾已被刪除,MySQL表不再存在。需要從頭開始清理和重新配置。 –

回答

1

嘗試查找文件host.frm並檢查組和它屬於的用戶。 「錯誤號:13」 是指:

~$ perror 13 
OS error code 13: Permission denied 

所以它可能是。 如果你沒有這樣的文件(也就是在mysql中的表),您必須用再生他們:

~$ mysql_install_db 

乾杯,

mazzi。

0

我在多個AWS服務器上多次看到過這個問題,在我的案例中主要的根本原因是缺乏空間。

所以,只是釋放服務器上的一些空間,並重新啓動你的mysqld,它應該開始工作正常。