首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >崩溃后启动MySQL时出错

问崩溃后启动MySQL时出错
EN

Stack Overflow用户
提问于 2015-05-28 20:32:08
回答 2查看 6.5K关注 0票数 1

当我的Mac崩溃时,我正高兴地用MAMP安装wordpress。现在我无法启动MySql。我在网上读到的大多数东西都告诉我要向它扔一些终端命令,试图扼杀这个过程。

代码语言:javascript
复制
killall -9 mysqld

但是终端报告“没有找到属于你的匹配过程”

因此,我在日志中查看了一下,从崩溃后的第一次重新启动尝试中可以看到这一点。

代码语言:javascript
复制
    150506 21:11:33 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
150506 21:11:33 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
150506 21:11:33 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
150506 21:11:33 [Note] Plugin 'FEDERATED' is disabled.
150506 21:11:33 InnoDB: The InnoDB memory heap is disabled
150506 21:11:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150506 21:11:33 InnoDB: Compressed tables use zlib 1.2.3
150506 21:11:33 InnoDB: Initializing buffer pool, size = 128.0M
150506 21:11:33 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
150506 21:11:33  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
150506 21:11:33  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
150506 21:11:33  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
150506 21:11:34  InnoDB: Waiting for the background threads to start
150506 21:11:35 InnoDB: 5.5.42 started; log sequence number 0
150506 21:11:35 [Note] Event Scheduler: Loaded 0 events
150506 21:11:35 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.5.42'  socket: '/Applications/MAMP/tmp/mysql/mysql.sock'  port: 0  Source distribution
150506 21:16:44 [Note] /Applications/MAMP/Library/bin/mysqld: Normal shutdown

所以表空间大小误差..。我是一个前端的家伙,不知道从哪里开始这个.?

请帮帮忙,我实在负担不起最后一周的工作。

谢谢你

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-05-28 20:56:50

正如您所指出的,InnoDB表空间已损坏,因此InnoDB无法启动。

InnoDB可以容忍一些错误,如果您使用选项innodb_force_recovery启动它。尝试从1到6的值,直到MySQL启动。

如果幸运的话,MySQL从innodb_force_recovery开始,然后将所有表转储到带有mysqldump的sql文件中,然后从头开始重新创建MySQL数据库。即将现有文件移动到某个安全的位置,启动mysql_install_db,更改文件权限并启动MySQL。然后将数据库加载回。

如果您不太幸运,而且MySQL没有从innodb_force_recovery=6开始,那么就检查如何使用恢复损坏的MySQL数据库。

为了避免将来发生这种情况,请使用用于Mac的XtraBackup进行备份。

票数 1
EN

Stack Overflow用户

发布于 2015-05-28 22:05:50

请见她:MAMP崩溃;MySQL将不会在重新启动时启动

感谢您为MacOS提供Xtrabackup的提示,您可以密切关注这一点。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30516553

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档