The server quit without updating PID file (/var/mysqltest1.pid).[FAILED

Michael_DD發表於2014-10-17
Starting MySQL....The server quit without updating PID file (/var/lib/mysql//mysqltest1.pid).[FAILED]



啟動失敗,檢視日誌資訊
[root@mysqltest1 mysql]# cd /var/lib/mysql
[root@mysqltest1 mysql]# ll
total 110772
-rwxr-xr-x 1 mysql mysql       56 Oct 17 01:07 auto.cnf
-rwxr-xr-x 1 mysql mysql 12582912 Oct 17 17:38 ibdata1
-rwxr-xr-x 1 mysql mysql 50331648 Oct 17 17:38 ib_logfile0
-rwxr-xr-x 1 mysql mysql 50331648 Oct 17 01:01 ib_logfile1
drwxr-xr-x 2 mysql mysql     4096 Oct 17 01:01 mysql
-rw-rw---- 1 mysql mysql        0 Oct 17 17:33 mysql-bin.index
-rwxr-xr-x 1 mysql mysql    34400 Oct 17 17:38 mysqltest1.err
drwxr-xr-x 2 mysql mysql     4096 Oct 17 01:01 performance_schema
-rwxr-xr-x 1 mysql mysql      113 Oct 17 01:01 RPM_UPGRADE_HISTORY
-rwxr-xr-x 1 mysql mysql      113 Oct 17 01:01 RPM_UPGRADE_MARKER-LAST
drwxr-xr-x 2 mysql mysql     4096 Oct 17 01:00 test
[root@mysqltest1 mysql]# cat mysqltest1.err
141017 17:33:37 mysqld_safe mysqld from pid file /var/lib/mysql//mysqltest1.pid ended
141017 17:38:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql/
2014-10-17 17:38:27 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-10-17 17:38:27 4128 [Note] Plugin 'FEDERATED' is disabled.
2014-10-17 17:38:27 4128 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-10-17 17:38:27 4128 [Note] InnoDB: The InnoDB memory heap is disabled
2014-10-17 17:38:27 4128 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-10-17 17:38:27 4128 [Note] InnoDB: Memory barrier is not used
2014-10-17 17:38:27 4128 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-10-17 17:38:27 4128 [Note] InnoDB: Using Linux native AIO
2014-10-17 17:38:27 4128 [Note] InnoDB: Using CPU crc32 instructions
2014-10-17 17:38:27 4128 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-10-17 17:38:27 4128 [Note] InnoDB: Completed initialization of buffer pool
2014-10-17 17:38:27 4128 [Note] InnoDB: Highest supported file format is Barracuda.
2014-10-17 17:38:27 4128 [Note] InnoDB: 128 rollback segment(s) are active.
2014-10-17 17:38:27 4128 [Note] InnoDB: Waiting for purge to start
2014-10-17 17:38:27 4128 [Note] InnoDB: 5.6.21 started; log sequence number 1626047
2014-10-17 17:38:27 4128 [ERROR] /usr/sbin/mysqld: unknown variable 'serverid=1'
2014-10-17 17:38:27 4128 [ERROR] Aborting

一般都是配置檔案有問題,可以檢視日誌資訊,處理

另外總結的原因:
1.可能是/usr/local/mysql/data/rekfan.pid檔案沒有寫的許可權
解決方法 :給予許可權,執行 “chown -R mysql:mysql /var/data” “chmod -R 755 /usr/local/mysql/data”  然後重新啟動mysqld!

2.可能程式裡已經存在mysql程式
解決方法:用命令“ps -ef|grep mysqld”檢視是否有mysqld程式,如果有使用“kill -9  程式號”殺死,然後重新啟動mysqld!

3.可能是第二次在機器上安裝mysql,有殘餘資料影響了服務的啟動。
解決方法:去mysql的資料目錄/data看看,如果存在mysql-bin.index,就趕快把它刪除掉吧,它就是罪魁禍首了。

4.mysql在啟動時沒有指定配置檔案時會使用/etc/my.cnf配置檔案,請開啟這個檔案檢視在[mysqld]節下有沒有指定資料目錄(datadir)。
解決方法:請在[mysqld]下設定這一行:datadir = /usr/local/mysql/data

5.skip-federated欄位問題
解決方法:檢查一下/etc/my.cnf檔案中有沒有沒被註釋掉的skip-federated欄位,如果有就立即註釋掉吧。

6.錯誤日誌目錄不存在
解決方法:使用“chown” “chmod”命令賦予mysql所有者及許可權

7.selinux惹的禍,如果是centos系統,預設會開啟selinux
解決方法:關閉它,開啟/etc/selinux/config,把SELINUX=enforcing改為SELINUX=disabled後存檔退出重啟機器試試。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29500582/viewspace-1301801/,如需轉載,請註明出處,否則將追究法律責任。

相關文章