service mysql start MySQL server PID file could not be found! Starting MySQL.............. ERROR! The server quit without updating PID file (/mydata/data/fisheye.pid).
InnoDB: 5.5.33 started; log sequence number 1006647152 mysqld got signal 11 -- 可能是 Bug、庫損壞、配置錯誤或硬件故障
df -h /dev/sda1 9.5G 9.5G 0 100% / ← 根分區滿
/etc/my.cnf 中 datadir 指向有空間的分區(如 /mnt/backup)。tar -czpf /mnt/backup/mysql_data.tar.gz /mydata/data → 解壓到新目錄 → chown -R mysql:mysql 新目錄。| 原因 | 排查命令/現象 | 解決動作 |
|---|---|---|
| 數據目錄分區滿 | df -h 顯示 100% | 遷移 datadir 或清理空間 |
| PID 文件無寫權限 | ls -l /mydata/data/ 屬主非 mysql | chown -R mysql:mysql /mydata/data/ |
| 殘留進程未清理 | ps -ef | grep mysqld 有進程 | kill -9 PID 後重啟 |
| 二次安裝殘留索引文件 | /mydata/data/mysql-bin.index 存在 | 刪除該文件 |
配置項 skip-federated 未註釋 | 錯誤日志 unknown option '--skip-federated' | my.cnf 中註釋掉該行 |
| SELinux 阻攔 | CentOS 默認 Enforcing | /etc/selinux/config 設 SELINUX=disabled 重啟機器 |
mysqldump fx > fx.sql mysqldump: Got error: 1146: Table 'user_suggest_report' doesn't exist when using LOCK TABLES
加 --skip-lock-tables 仍報:Couldn't read status information for table vote_results / show create table user_suggest_report: doesn't exist。
SHOW TABLES; 表存在。DROP TABLE user_suggest_report; 報語法錯誤(元數據不一致)。/var/lib/mysql/fx/ 發現 user_suggest_report.frm 孤兒文件(無對應 .ibd)。mv user_suggest_report.frm /data/service mysqld restart表文件與 InnoDB 數據字典不同步(如誤刪 .ibd、崩潰恢復不全),導致 frm 孤兒。MySQL 以 frm 為準判定表存在,InnoDB 層找不到數據文件報錯。
CHECK TABLE / ANALYZE TABLE 發現異常。FLUSH TABLES WITH READ LOCK 確保一致性(僅限小庫)。xtrabackup、mysqldump --single-transaction)。