王涛的BLOG

您的潜力,我们的动力!

原创 解决Linux上安装MYSQL“mysqld 已死,但是 subsys 被锁 ”的方法收藏

新一篇: Linux服务设置方法 | 旧一篇: 解决关于FreeTextBox等于4K不能保存的问题

今天在RED HAT 9上面安装了MYSQL,但是在service mysql start以后,查看service  mysql status的时候出现以下提示:

mysqld 已死,但是 subsys 被锁

我起初还看了日志文件,日志文件提示:

Cannot initialize InnoDB as 'innodb_data_file_path' is not set.
If you do not want to use transactional InnoDB tables, add a line
skip-innodb
to the [mysqld] section of init parameters in your my.cnf
or my.ini. If you want to use InnoDB tables, add to the [mysqld]
section, for example,
innodb_data_file_path = ibdata1:10M:autoextend
But to get good performance you should adjust for your hardware
the InnoDB startup options listed in section 2 at
http://www.innodb.com/ibman.html
060806 12:51:01  /usr/libexec/mysqld: Incorrect information in file: './mysql/host.frm'
060806 12:51:01  mysqld ended

我感觉日志文件好象不怎么对,说实话对于一个新手来说,我连.cnf文件在哪里都不知道,我后来在MYSQL的论坛里找到了解决方法,至于原理,我还没有漫漫体会,我把原版的英文发给大家看看:

1. Obviously the 'ole check the log file for anything nasty

cat /var/log/mysqld.log

2. Stop the service

service mysqld stop

3. Check to see if the service stopped, it might be calling the wrong pid.

ps aux | grep mysql

4. Kill any mysql process that might still be running.

kill -9 ??? ???

5. (*CAREFUL*) Remove/move/backup any databases from the data directory, only do this step if you need to.

rm -Rf /var/lib/mysql/*

6. Check your global options configuration file, should be similar to stevanbt's initial post.

cat /etc/my.cnf

7. Copy over one of the preconfigured 'sample' server-specific options file. Global (/etc/my.cnf) file has priority over server-specific file, but these have more options in them and have been tuned for a certain role.

cp /usr/share/doc/mysql-server-?.??.??/my-small.cnf /var/lib/mysql

8. Recreate the initial databases, this step is optional as the initscripts will do this anyway.

mysql_install_db

9. Check and set the runlevels for the service.

chkconfig --level 345 mysqld on
chkconfig --list mysqld

10. Start the service.

service mysqld start

11. Check the log file (step 1)

Thats just a basic step through check, most of you have probably already done this.

 

其实做到step 9问题都已经解决了

发表于 @ 2006年08月06日 13:44:00|评论(loading...)|编辑

新一篇: Linux服务设置方法 | 旧一篇: 解决关于FreeTextBox等于4K不能保存的问题

评论

#allan 发表于2006-08-23 12:40:00  IP: 60.186.85.*
写得很好,顶一个。继续加油!
#Brady 发表于2007-07-21 13:36:35  IP: 200.85.65.*
a70028c50244638565b5ec5263baded5 canavese calzi lg ku950 costa progetto ground zero olga transex gratis premio letterario pianeta donna fiorella peruzzi piero pelu forever psicosi cronica bipolare conseguenza alchool fragilita capillare venosa riforma processo tributario nuova avventura capitan harlock b8fb7d84153cc5c69600cbe1497734b2
发表评论  


登录
Csdn Blog version 3.1a
Copyright © 王涛