背景:在centos6.8系统上修改mysql的Binlog、server-id配置,直接重启mysql时发生的错误(启动失败)。
日志 /var/lib/mysql/chdp11.err
(主机名chdp11)
2019-11-07 12:52:03 11150 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2019-11-07 12:52:03 11150 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2019-11-07 12:52:03 11150 [Note] InnoDB: Unable to open the first data file
2019-11-07 12:52:03 7f9fa6d0f720 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.6/en/operating-system-error-codes.html
2019-11-07 12:52:03 11150 [ERROR] InnoDB: Can't open './ibdata1'
2019-11-07 12:52:03 11150 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2019-11-07 12:52:03 11150 [ERROR] Plugin 'InnoDB' init function returned error.
2019-11-07 12:52:03 11150 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-11-07 12:52:03 11150 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-11-07 12:52:03 11150 [ERROR] Aborting2019-11-07 12:52:03 11150 [Note] Binlog end
2019-11-07 12:52:03 11150 [Note] Shutting down plugin 'partition'
提取关键信息
2019-11-07 12:52:03 11150 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2019-11-07 12:52:03 11150 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
有其他mysql守护进程占用了锁资源?
立马输入ps -ef|grep mysql
,刷出如下结果。
果真如此。
是因为修改server-id后导致的进程未成功关闭残留?
全部kill掉,问题解决。
ps -ef | grep mysql | grep -v grep | awk '{print $2}' | xargs kill