MAMP mysql 服务器无法启动。没有 mysql 进程正在运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16021564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 17:21:09  来源:igfitidea点击:

MAMP mysql server won't start. No mysql processes are running

mysqlmamp

提问by jordancooperman

My MAMP mysql server won't start. All of the suggestions I've seen on the web say to check for other mysqld processes running and kill them if they exist, and that it should fix the problem, but it has not for me.

我的 MAMP mysql 服务器无法启动。我在网上看到的所有建议都说要检查其他正在运行的 mysqld 进程并杀死它们(如果它们存在),并且它应该解决问题,但对我来说却没有。

Here's the error log:

这是错误日志:

130415 13:42:12 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
130415 13:42:12 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
130415 13:42:12 [Note] Plugin 'FEDERATED' is disabled.
130415 13:42:12 InnoDB: The InnoDB memory heap is disabled
130415 13:42:12 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130415 13:42:12 InnoDB: Compressed tables use zlib 1.2.3
130415 13:42:12 InnoDB: Initializing buffer pool, size = 128.0M
130415 13:42:12 InnoDB: Completed initialization of buffer pool
130415 13:42:12 InnoDB: highest supported file format is Barracuda.
130415 13:42:13  InnoDB: Waiting for the background threads to start
130415 13:42:14 InnoDB: 1.1.8 started; log sequence number 1707549
130415 13:42:14 [Note] Event Scheduler: Loaded 0 events
130415 13:42:14 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.5.25'  socket: '/Applications/MAMP/tmp/mysql/mysql.sock'  port: 0  Source distribution

It looks like the connection is open to me, but MAMP stil errors out with this message: "MySQL wasn't able to start. Please check log for more information."

看起来连接对我来说是开放的,但 MAMP 仍然错误并显示以下消息:“MySQL 无法启动。请检查日志以获取更多信息。”

Any suggestions?

有什么建议?

回答by Eric Grotke

What worked for me was removing all files (but not directories) in the mysql dir.

对我有用的是删除 mysql 目录中的所有文件(但不是目录)。

Edit #2 As per answers below, you only need to delete the log files: [ib_logfile0, ib_logfile1]

编辑 #2 根据下面的答案,您只需要删除日志文件:[ib_logfile0, ib_logfile1]

So quit MAMP and then in the terminal:

所以退出 MAMP 然后在终端中:

rm /Applications/MAMP/db/mysql/ib_logfile* #(or wherever your MAMP is installed)

Edit!: A few people have mentioned that you may want to back up these files first in case anything goes wrong, so maybe just use mv instead:

编辑!:有些人提到你可能想先备份这些文件,以防万一出现问题,所以也许只用 mv 代替:

mv /Applications/MAMP/db/mysql/*  /tmp/.

If this doesn't work go back and kill all processes: sudo killall -9 mysqld

如果这不起作用,请返回并终止所有进程: sudo killall -9 mysqld

This is also duplicated here: mysql server won't start MAMP

这也在这里重复: mysql server won't start MAMP

回答by user3127648

The easiest solution: quit MAMP and remove the log files from MAMP/db/mysql directory [ib_logfile0, ib_logfile1] and restart MAMP. For more visit http://juanfra.me/2013/01/mysql-not-starting-mamp-fix/

最简单的解决方案:退出MAMP并从MAMP/db/mysql目录[ib_logfile0, ib_logfile1]中删除日志文件并重新启动MAMP。更多信息请访问http://juanfra.me/2013/01/mysql-not-starting-mamp-fix/

回答by JSEvgeny

rm /Applications/MAMP/db/mysql56/*

Works fine, but then it shows "No database found" in phpmyadmin although there are databases, so my drupal gave me errors because of this.

工作正常,但是尽管有数据库,但它在 phpmyadmin 中显示“未找到数据库”,因此我的 drupal 给了我错误。

All I need to do is simply remove two files ib_logfile0and ib_logfile1from /Applications/MAMP/db/mysql56/and that did the trick for me.

所有我需要做的就是简单地删除这两个文件ib_logfile0,并ib_logfile1/Applications/MAMP/db/mysql56/与该诀窍我。

回答by Tracey

I looked at the MAMP site. Go into MAMP/db/mysql56and rename both the log files (I just changed the number at the end). Voila, restarted MAMP and all was well.

我查看了 MAMP 网站。进入MAMP/db/mysql56并重命名两个日志文件(我只是在最后更改了数字)。瞧,重新启动 MAMP,一切都很好。

Log File names:

日志文件名:

  1. ib_logfile0
  2. ib_logfile1
  1. ib_logfile0
  2. ib_logfile1

回答by Valter Lee

  1. Stop MAMP server.
  2. Then go in following folder:
  1. 停止 MAMP 服务器。
  2. 然后进入以下文件夹:

Applications/MAMP/db/mysql56/

应用程序/MAMP/db/mysql56/

In this folder, please remove all direct files except folders. This means that you have to remove only auto.cnf, ibdata, ib_logfile,not any folders.

在此文件夹中,请删除除文件夹之外的所有直接文件。这意味着您只需删除auto.cnf, ibdata, ib_logfile,任何文件夹。

  1. Restart MAMP server.
  1. 重新启动 MAMP 服务器。

It should work.

它应该工作。

Thank you.

谢谢你。

回答by Adel 'Sean' Helal

Most of the answers here are offering to delete random files.

这里的大多数答案都提供删除随机文件。

Most of the time, this is the worst thing to doespecially if it is important for you to keep the integrity of your development environment.

大多数情况下,这是最糟糕的事情,尤其是当您保持开发环境的完整性很重要时。

As explained in the log file, if this problem is not related to a read access permission nor to a file you deleted in your mysql then the only solution is to:

如日志文件中所述,如果此问题与读取访问权限无关,也与您在 mysql 中删除的文件无关,那么唯一的解决方案是:

Open your my.conf file from the File menu in MAMP (File > Edit Template > MySQL)

Find and edit this line to be: innodb_force_recovery = 1

Save with ctrl+S

MAMP will offer you to restart your servers

Go back building the next unicorn :)

从 MAMP 的文件菜单中打开 my.conf 文件(文件 > 编辑模板 > MySQL)

查找并编辑此行为: innodb_force_recovery = 1

使用 ctrl+S 保存

MAMP 将让您重新启动服务器

回去建造下一个独角兽:)

回答by Manish Shrivastava

Just type below command in terminal:

只需在终端中输入以下命令:

rm /Applications/MAMP/db/mysql56/ib_logfile* 

and then restart the MAMP.

然后重新启动 MAMP。

It works back perfectly.

它可以完美地恢复。

回答by ksav

Since none of the answers here solved my particular issue, I should probably add my own solution to to the list.

由于这里的答案都没有解决我的特定问题,我可能应该将我自己的解决方案添加到列表中。

I had to hard reset my computer while MAMP was still running. After restarting the machine, this sometimes leads to a problem where MAMP canstart the Apache Server, but can notstart the MySQL serverfor some reason.

当 MAMP 仍在运行时,我不得不硬重置我的计算机。重新启动机器后,这有时会导致MAMP可以启动Apache Server,但由于某种原因无法启动的问题MySQL server

My solution for this issue was to:

我对这个问题的解决方案是:

  • Close MAMP
  • Go to Applications/MAMP/tmp/mysql
  • delete the file mysql.sock.lock
  • Restart MAMP
  • 关闭 MAMP
  • Applications/MAMP/tmp/mysql
  • 删除文件 mysql.sock.lock
  • 重启 MAMP

回答by Leo

I had to do a combination of things. First I had to change the permissions on my mysql directory. applications/MAMP/db/mysql56/mysql see Stackoverflow here

我不得不做一些事情。首先,我必须更改我的 mysql 目录的权限。应用程序/MAMP/db/mysql56/mysql在此处查看 Stackoverflow

If that doesn't work add in a my.cnf file to applications/MAMP/conf folder with the following

如果这不起作用,请使用以下内容将 my.cnf 文件添加到 applications/MAMP/conf 文件夹

[mysqld]
innodb_force_recovery = 1

see Adel 'Sean' Helal . answer

见 Adel 'Sean' Helal。回答

This is what ended up working for me.

这就是最终为我工作的原因。

回答by Sébastien Gicquel

I've seen on different answers that we have to remove ib_logfile0and ib_logfile1in Applications/MAMP/db/mysql56/

我已经看到了不同的答案,我们必须删除ib_logfile0ib_logfile1Applications/MAMP/db/mysql56/

If you use MAMP PRO 4, these files are in /Library/Application Support/appsolute/MAMP PRO/db/mysql56/

如果您使用 MAMP PRO 4,这些文件在 /Library/Application Support/appsolute/MAMP PRO/db/mysql56/

Removing theses fils works for me (the serveur doesn't start after a system crash).

删除这些文件对我有用(服务器在系统崩溃后不会启动)。