Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
829 views
in Technique[技术] by (71.8m points)

mysql - improper killing of mysqld - now not starting

I stopped mysqld by killing the process id, and then deleted mysqld.sock file also. Now, mysqld is not starting.

I know there is some data corruption. But now I need to start MySQL without re-installing it.

Below are the logs that generated.


    InnoDB: using the same InnoDB data or log files.
    InnoDB: Unable to lock ./ibdata1, error: 11
    InnoDB: Check that you do not already have another mysqld process
    InnoDB: using the same InnoDB data or log files.
    140107  8:27:43  InnoDB: Unable to open the first data file
    InnoDB: Error in opening ./ibdata1
    140107  8:27:43  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.1/en/operating-system-error-codes.html
    InnoDB: Could not open or create data files.
    InnoDB: If you tried to add new data files, and it failed here,
    InnoDB: you should now edit innodb_data_file_path in my.cnf back
    InnoDB: to what it was, and remove the new ibdata files InnoDB created
    InnoDB: in this failed attempt. InnoDB only wrote those files full of
    InnoDB: zeros, but did not yet use them in any way. But be careful: do not
    InnoDB: remove old data files which contain your precious data!
    140107  8:27:43 [ERROR] Plugin 'InnoDB' init function returned error.
    140107  8:27:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    140107  8:27:43 [ERROR] /usr/libexec/mysqld: unknown option '--ndbcluster'
    140107  8:27:43 [ERROR] Aborting

    140107  8:27:43 [Note] /usr/libexec/mysqld: Shutdown complete

    140107 08:27:43 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to restore the innodb data files.

# cd /var/lib/mysql
# mkdir bak
# mv ibdata1 bak/
# mv ib_logfile* bak/
# cp -a bak/ibdata1 ibdata1
# cp -a bak/ib_logfile* .
# rm -rf bak
# service mysqld restart

Reference: http://notesonit.blogspot.hk/2013/05/innodb-unable-to-lock-ibdata1-error-11.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...