MySQLを再起動したときのエラー

            MySQLが死んでたので再起動しようとしたら、起動時にエラーになった。

[bash] [root@tnnsst35 ~]# /etc/rc.d/init.d/mysqld start MySQL Daemon failed to start. mysqld を起動中: [失敗] [/bash]

なんだよーと思いつつ、とりあえずエラーログを確認する。 [bash] [root@tnnsst35 ~]# less /var/log/mysqld.log

InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. InnoDB: Unable to lock ./ibdata1, error: 11

120120 11:13:39 InnoDB: Unable to open the first data file InnoDB: Error in opening ./ibdata1 120120 11:13:39 InnoDB: Operating system error number 11 in a file operation. InnoDB: Error number 11 means 'Resource temporarily unavailable'. InnoDB: Some operating system error numbers are described at InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html 120120 11:13:39 InnoDB: Could not open or create data files. 120120 11:13:39 InnoDB: If you tried to add new data files, and it failed here, 120120 11:13:39 InnoDB: you should now edit innodb_data_file_path in my.cnf back 120120 11:13:39 InnoDB: to what it was, and remove the new ibdata files InnoDB created 120120 11:13:39 InnoDB: in this failed attempt. InnoDB only wrote those files full of 120120 11:13:39 InnoDB: zeros, but did not yet use them in any way. But be careful: do not 120120 11:13:39 InnoDB: remove old data files which contain your precious data! 120120 11:13:39 [ERROR] Plugin 'InnoDB' init function returned error. 120120 11:13:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 120120 11:13:39 [ERROR] Unknown/unsupported storage engine: InnoDB 120120 11:13:39 [ERROR] Aborting

120120 11:13:39 [Note] /usr/libexec/mysqld: Shutdown complete [/bash]

1行目の「Check that you do not already have another mysqld process」から察するにすでにプロセスが動いているらしい。たぶん。 プロセスを確認してみる。 [bash] ps -ef | grep mysql [/bash]

案の定それっぽいプロセスがいたのでkillした。 それから起動したらすんなり起動できた。

おわり。