標籤:“mysqld已死 但是subsys被鎖”
今天安裝好了centos 6.5 32位系統,遠程安裝好了MySQL,進入mysql後,有事忘了退出來,當我想起來之後,遠程已經中斷連線,重新串連ssh,登入MySQL,輸入密碼提示錯誤,檢查服務:service mysqld status
[[email protected] ~]# service mysqld statusmysqld 已死,但是 subsys 被鎖[[email protected] ~]#
然後查詢下資料,按照以下步驟:
[[email protected] ~]# service mysqld stop停止 mysqld: [確定][[email protected] ~]#
[[email protected] ~]# ps aux|grep mysqlroot 13690 0.0 0.0 6764 1420 ? S 04:10 0:00 /bin/sh /usr/bin/mysqld_safe --user=root --skip-grant-tablesmysql 14708 0.0 0.7 135412 15024 ? Sl 04:26 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=root --skip-grant-tables --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sockroot 15558 0.0 0.0 6736 1412 pts/1 S 04:49 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysqlmysql 15660 0.0 0.6 80748 11840 pts/1 Sl 04:49 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sockroot 16107 0.0 0.0 5984 764 pts/1 S+ 04:51 0:00 grep mysql[[email protected]localhost ~]#
[[email protected] ~]# [[email protected] ~]# kill -9 14708 //殺死mysql進程[[email protected] ~]#
[[email protected] ~]# ps aux|grep mysql //mysql進程都關閉了root 16170 0.0 0.0 5980 756 pts/1 S+ 04:53 0:00 grep mysql[[email protected] ~]# [[email protected] ~]# service mysqld statusmysqld 已死,但是 subsys 被鎖[[email protected] ~]#
[[email protected] ~]# service mysqld restart //重啟mysql服務,重新串連停止 mysqld: [確定]正在啟動 mysqld: [確定][[email protected] ~]#
[[email protected] ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql> //串連成功,進入MySQLmysql> mysql> exitBye[[email protected] ~]#
以下是網上參考資料:
今天在Red Hat Linux 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
060806 12:51:01 /usr/libexec/mysqld: Incorrect information in file: ‘./mysql/host.frm‘
060806 12:51:01 mysqld ended
我把原版的英文發給大家看看:
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問題都已經解決了。
centos6.5安裝MYSQL“mysqld已死,但是subsys被鎖”的解決方案