gpt4 book ai didi

mysql - 系统崩溃; mysql数据已备份,但无法让mysql识别它(MAMP)

转载 作者:行者123 更新时间:2023-11-29 12:57:45 24 4
gpt4 key购买 nike

免责声明:业余程序员,在任何意义上都不是专业人士,并且没有任何系统管理方面的技能,尤其是数据库。

很多人都有和我一样的问题,但我见过的解决方案都不适合我。似乎每种情况的细节都不同。我的系统不久前崩溃了,但我我的 MAMP mysql 文件夹下的所有内容都有一个相当新的备份,所以我想我会没事的。但是从备份中恢复 mysql 文件夹似乎不起作用,这似乎与我从其他人那里读到的内容一致问同样的问题。当我运行 MAMP 时,mysql 根本无法启动。日志文件(下面)说我应该对 my.cnf 做一些事情,但我在任何地方都找不到 my.cnf,就像我说的,我刚刚安装了 MAMP,所以我认为它会在那里。

无论如何,我该如何解决这个问题?我是不是完蛋了?

140520 22:01:33 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
140520 22:01:33 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql/ is case insensitive
140520 22:01:33 [Note] Plugin 'FEDERATED' is disabled.
140520 22:01:33 InnoDB: The InnoDB memory heap is disabled
140520 22:01:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140520 22:01:33 InnoDB: Compressed tables use zlib 1.2.3
140520 22:01:33 InnoDB: Initializing buffer pool, size = 128.0M
140520 22:01:33 InnoDB: Completed initialization of buffer pool
InnoDB: Error: space header page consists of zero bytes in data file ./ibdata1
140520 22:01:33 InnoDB: Could not open or create data files.
140520 22:01:33 InnoDB: If you tried to add new data files, and it failed here,
140520 22:01:33 InnoDB: you should now edit innodb_data_file_path in my.cnf back
140520 22:01:33 InnoDB: to what it was, and remove the new ibdata files InnoDB created
140520 22:01:33 InnoDB: in this failed attempt. InnoDB only wrote those files full of
140520 22:01:33 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
140520 22:01:33 InnoDB: remove old data files which contain your precious data!
140520 22:01:33 [ERROR] Plugin 'InnoDB' init function returned error.
140520 22:01:33 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140520 22:01:33 [ERROR] Unknown/unsupported storage engine: InnoDB
140520 22:01:33 [ERROR] Aborting

140520 22:01:33 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete

140520 22:01:33 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended

最佳答案

有四件事您可以尝试

  1. 使用数据库恢复软件恢复您的数据

  2. 我发现以下内容适合我

    lsof -i | grep mysql

    这将返回 mysqld 加上一个数字(加上其他信息),在我的例子中,响应开始

    mysqld 573

    现在输入kill加上你得到的数字;就我而言

    kill 573

  3. 尝试更改您的 mysql 密码或端口号

  4. innodb_use_sys_malloc =0<​​设置到my.cnf中并重新启动MySQL。

关于mysql - 系统崩溃; mysql数据已备份,但无法让mysql识别它(MAMP),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23774366/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com