MySQL 服务器退出而不更新 PID 文件

MySQL 服务器退出而不更新 PID 文件

我需要有关如何启动 mysql 服务器的帮助。当根目录已满时,就会出现问题。为了能够登录 directadmin 并启动 mysql,我添加了 /var/lib/mysql/ 到 /home/mysql 的软链接。因为我的数据库用完了数据库。/ 目录有 50Gb,/home 有 1.5Gb。但我仍然无法启动 mysql。

我运行/etc/init.d/mysqld status,结果如下:

MySQL is not running, but lock file (/var/lock/subsys/mysql)

我尝试删除文件 /var/lock/subsys/mysql

但是当我尝试启动 mysql 时,它给出了以下结果:

[root@fst /]# /etc/init.d/mysqld start
Starting MySQL.The server quit without updating PID file (/var/lib/mysql/fst.srv.net.pid).

我已经检查了 mysql 的权限和文件所有者,但结果相同。

chmod 755 -R /var/lib/mysql
chown mysql:root /var/lib/mysql

我也找不到 mysql.sock。但我猜想它会在 mysql 启动时创建。

以下是错误日志的内容

121212 01:04:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
121212  1:04:22 [Note] Plugin 'FEDERATED' is disabled.
121212  1:04:22 InnoDB: The InnoDB memory heap is disabled
121212  1:04:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121212  1:04:22 InnoDB: Compressed tables use zlib 1.2.3
121212  1:04:22 InnoDB: Using Linux native AIO
121212  1:04:22 InnoDB: Initializing buffer pool, size = 128.0M
121212  1:04:22 InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 64 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
121212  1:04:22 InnoDB: Could not open or create data files.
121212  1:04:22 InnoDB: If you tried to add new data files, and it failed here,
121212  1:04:22 InnoDB: you should now edit innodb_data_file_path in my.cnf back
121212  1:04:22 InnoDB: to what it was, and remove the new ibdata files InnoDB created
121212  1:04:22 InnoDB: in this failed attempt. InnoDB only wrote those files full of
121212  1:04:22 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
121212  1:04:22 InnoDB: remove old data files which contain your precious data!
121212  1:04:22 [ERROR] Plugin 'InnoDB' init function returned error.
121212  1:04:22 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121212  1:04:22 [ERROR] Unknown/unsupported storage engine: InnoDB
121212  1:04:22 [ERROR] Aborting

121212  1:04:22 [Note] /usr/sbin/mysqld: Shutdown complete

我很困惑这个问题是什么。请帮助我。我已经研究这个问题两天了。

答案1

看起来你的 InnoDB 索引已损坏。

InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
121212  1:04:22 InnoDB: Could not open or create data files.

尝试将 等移动/var/lib/mysql/ibdata1/var/lib/mysql/ibdata2其他目录并重新启动服务器。它应该会重建索引文件。一旦完成并且您确认一切恢复正常,您就可以删除旧的损坏文件。

相关内容