在我的一台服务器上,SSD 已满,而我却没有意识到。
高流量网站的运行速度变得非常慢,然后开始显示错误,因为即使是数据库也无法保存新行。
在我弄清楚发生了什么之前,我执行了硬重启。然后mysqld服务无法启动。
我开始删除一些不重要的文件(结果80%的空间都是垃圾),所以现在我有80%的可用空间。
不幸的是,每次我尝试运行“service mysqld restart”或启动时,它都会启动然后立即停止。
我的配置: - Debian 7.5 + DirectAdmin(Apache、MySQL), - 数据库很大,包括 MyISAM 和 InnoDB 表。
我尝试进行导出,但如果没有运行 mysqld 服务则无法运行 mysqldump。
我从 /usr/local/mysql/data 复制了我的表,并且还有一个备份,但采用 SQL 格式 - 所以我无法导入它。但最好的选择是运行当前表,因为备份是旧的。
到目前为止我已经尝试过:
- myisamchk -r -v *.MYI
- 设置“innodb_force_recovery=3”(首先我尝试了1和2)
- 多次硬重启并重新启动所有服务
- 更改损坏的数据库文件夹的名称,但随后我在日志中看到错误(找不到表文件等)
MySQL 日志没有解释任何内容:
150813 15:48:13 mysqld_safe mysqld from pid file /usr/local/mysql/data/ns390143.pid ended
150813 15:48:21 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2015-08-13 15:48:21 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-08-13 15:48:21 2954 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
2015-08-13 15:48:21 2954 [Note] Plugin 'FEDERATED' is disabled.
2015-08-13 15:48:21 2954 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-13 15:48:21 2954 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-13 15:48:21 2954 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-08-13 15:48:21 2954 [Note] InnoDB: Using Linux native AIO
2015-08-13 15:48:21 2954 [Note] InnoDB: Using CPU crc32 instructions
2015-08-13 15:48:21 2954 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-13 15:48:21 2954 [Note] InnoDB: Completed initialization of buffer pool
2015-08-13 15:48:21 2954 [Note] InnoDB: Highest supported file format is Barracuda.
2015-08-13 15:48:21 2954 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-13 15:48:21 2954 [Note] InnoDB: Waiting for purge to start
2015-08-13 15:48:21 2954 [Note] InnoDB: 5.6.12 started; log sequence number 28646291749
2015-08-13 15:48:21 2954 [ERROR] Aborting
2015-08-13 15:48:21 2954 [Note] Binlog end
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'partition'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'ARCHIVE'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_METRICS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_CMP'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'INNODB_TRX'
2015-08-13 15:48:21 2954 [Note] Shutting down plugin 'InnoDB'
2015-08-13 15:48:21 2954 [Note] InnoDB: FTS optimize thread exiting.
2015-08-13 15:48:21 2954 [Note] InnoDB: Starting shutdown...
2015-08-13 15:48:23 2954 [Note] InnoDB: Shutdown completed; log sequence number 28646291759
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'BLACKHOLE'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'CSV'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'MRG_MYISAM'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'MyISAM'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'MEMORY'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'sha256_password'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'mysql_old_password'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'mysql_native_password'
2015-08-13 15:48:23 2954 [Note] Shutting down plugin 'binlog'
2015-08-13 15:48:23 2954 [Note]
我的问题是:
如何修复它?这可能吗?
如果没有,如何导入.sql文件备份?