简体   繁体   English

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

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

My MAMP mysql server won't start.我的 MAMP mysql 服务器无法启动。 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.我在网上看到的所有建议都说要检查其他正在运行的 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?有什么建议?

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

The easiest solution: quit MAMP and remove the log files from MAMP/db/mysql directory [ib_logfile0, ib_logfile1] and restart MAMP.最简单的解决方案:退出MAMP并从MAMP/db/mysql目录[ib_logfile0, ib_logfile1]中删除日志文件并重新启动MAMP。 For more visit http://juanfra.me/2013/01/mysql-not-starting-mamp-fix/更多信息请访问http://juanfra.me/2013/01/mysql-not-starting-mamp-fix/

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.当 MAMP 仍在运行时,我不得不硬重置我的计算机。 This sometimes leads to a problem where, after restarting the machine MAMP can start the Apache Server , but can not start the MySQL server for some reason.这有时会导致一个问题,重启机器后 MAMP可以启动Apache Server ,但由于某种原因无法启动MySQL server

My solution for this issue was to:我对这个问题的解决方案是:

  • Close MAMP关闭 MAMP
  • Go to Applications/MAMP/tmp/mysql转到Applications/MAMP/tmp/mysql
  • delete the file mysql.sock.lock删除文件mysql.sock.lock
  • Restart MAMP重启 MAMP
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_logfile0 and ib_logfile1 from /Applications/MAMP/db/mysql56/ and that did the trick for me.我需要做的只是从/Applications/MAMP/db/mysql56/删除两个文件ib_logfile0ib_logfile1 ,这对我/Applications/MAMP/db/mysql56/

I looked at the MAMP site.我查看了 MAMP 网站。 Go into MAMP/db/mysql56 and rename both the log files (I just changed the number at the end).进入MAMP/db/mysql56并重命名两个日志文件(我只是在最后更改了数字)。 Voila, restarted MAMP and all was well.瞧,重新启动 MAMP,一切都很好。

Log File names:日志文件名:

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

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.重新启动 MAMP 服务器。

It should work.它应该工作。

Thank you.谢谢你。

Most of the answers here are offering to delete random files.这里的大多数答案都提供删除随机文件。

Most of the time, this is the worst thing to do especially 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)从 MAMP 的文件菜单中打开 my.conf 文件(文件 > 编辑模板 > MySQL)

Find and edit this line to be: innodb_force_recovery = 1查找并编辑此行为: innodb_force_recovery = 1

Save with ctrl+S使用 ctrl+S 保存

MAMP will offer you to restart your servers MAMP 将让您重新启动服务器

Go back building the next unicorn :)回去建造下一个独角兽:)

Just type below command in terminal:只需在终端中输入以下命令:

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

and then restart the MAMP.然后重新启动 MAMP。

It works back perfectly.它可以完美地恢复。

I had to do a combination of things.我不得不做一些事情。 First I had to change the permissions on my mysql directory.首先,我必须更改我的 mysql 目录的权限。 applications/MAMP/db/mysql56/mysql see Stackoverflow here应用程序/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 .见 Adel 'Sean' Helal。 answer回答

This is what ended up working for me.这就是最终为我工作的原因。

Im posting this as a potensial Answer!我将此作为潜在的答案发布!

What i did to solve this was the following:我为解决这个问题所做的如下:

  1. Restart the computer ( to make sure no mysqld processes are running, even if it crashed and tries to restart itself)重新启动计算机(以确保没有 mysqld 进程正在运行,即使它崩溃并尝试自行重新启动)
  2. Delete everything that has anything to do with mysql on the computer by running these commands:通过运行以下命令,删除计算机上与 mysql 相关的所有内容:
     sudo rm /usr/local/mysql sudo rm -rf /usr/local/mysql* sudo rm -rf /Library/StartupItems/MySQLCOM sudo rm -rf /Library/PreferencePanes/MySQL* vim /etc/hostconfig and removed the line MYSQLCOM=-YES- rm -rf ~/Library/PreferencePanes/MySQL* sudo rm -rf /Library/Receipts/mysql* sudo rm -rf /Library/Receipts/MySQL* sudo rm -rf /var/db/receipts/com.mysql.*
  3. Delete MAMP by running the MAMP PRO uninstaller, then deleting the applications/MAMP folder通过运行 MAMP PRO 卸载程序删除 MAMP,然后删除应用程序/MAMP 文件夹
  4. Delete the Library/Application Support/appsolute folder (MAMP application support folder)删除Library/Application Support/appsolute文件夹(MAMP 应用程序支持文件夹)
  5. Reinstall MAMP PRO重新安装 MAMP PRO

Hopefully this helps :)希望这会有所帮助:)

I just had this problem.我刚遇到这个问题。 These are the steps that worked for me.这些是对我有用的步骤。

  1. Open Preferences in MAMP, make a note of your current Apache and MySQL Port numbers .在 MAMP 中打开Preferences记下您当前的 Apache 和 MySQL 端口号

    在此处输入图片说明

  2. Click both Set to default Apache and MySQL ports and Reset MAMP buttons then OK.单击“ Set to default Apache and MySQL ports和“ Reset MAMP按钮,然后单击“确定”。

  3. Quit MAMP退出 MAMP

  4. Delete all files (not folders) from /Applications/MAMP/db/mysql directory./Applications/MAMP/db/mysql目录中删除所有文件(不是文件夹)。

  5. Reboot MAMP and click Start Servers .重新启动 MAMP 并单击Start Servers

    Note: if MySQL starts fine but Apache doesn't, go back to Preferences and set Apache Port back to what it was before.注意:如果 MySQL 可以正常启动但 Apache 不能正常启动,请返回Preferences并将 Apache Port 设置回之前的状态。 MAMP should refresh after you click OK and both Apache and MySQL should start.单击“确定”后 MAMP 应该刷新,Apache 和 MySQL 都应该启动。

  6. If http://localhost/MAMP/index.php fails to load, open Developer Tools (Chrome), right-click on refresh button and select Empty Cache and Hard Reload .如果http://localhost/MAMP/index.php加载失败,打开开发者工具(Chrome),右键点击刷新按钮并选择Empty Cache and Hard Reload The phpAdmin page should load. phpAdmin 页面应该加载。 If not try going to Application panel in Developer tools, select Clear Storage from the menu and click Clear Site Data .如果不尝试转到开发人员工具中的Application面板,请从菜单中选择Clear Storage并单击Clear Site Data

I hope those steps provide a quick fix for someone without needed to destroy your database tables.我希望这些步骤可以为不需要破坏数据库表的人提供快速修复。

I've seen on different answers that we have to remove ib_logfile0 and ib_logfile1 in Applications/MAMP/db/mysql56/我在不同的答案中看到我们必须删除Applications/MAMP/db/mysql56/中的ib_logfile0ib_logfile1

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).删除这些文件对我有用(服务器在系统崩溃后不会启动)。

Ok, so I tried EVERY suggestion i found here on SO and other forums I nothing worked for me.好的,所以我尝试了我在 SO 和其他论坛上找到的每个建议,但对我没有任何帮助。 The only solution, that worked for me was to install MAMP 3 version, since I use MAMP for wordpress projects version 3 works just fine.唯一对我有用的解决方案是安装 MAMP 3 版本,因为我将 MAMP 用于 wordpress 项目版本 3 工作得很好。

MAMP & MAMP PRO 4.0.6 was starting MySql server correctly but stopped doing so after my machine updated the OS to macOS Sierra (10.12.2) . MAMP & MAMP PRO 4.0.6正确启动了 MySql 服务器,但在我的机器将操作系统更新到macOS Sierra (10.12.2)后停止了。 I tried a few options mentioned here including setting folder permissions and re-install etc. Nothing seemed fixed the issue for me so I shifted to XAMPP and it is serving OK so far.我尝试了这里提到的几个选项,包括设置文件夹权限和重新安装等。似乎没有什么能解决我的问题,所以我转向XAMPP ,到目前为止它的服务还可以。

Update: I've got MAMP working with this simple solution here .更新:我让 MAMP 在这里使用这个简单的解决方案。

Remove the files ib_logfileN (N being the number) from the MAMP/db/mysql56 folder.从 MAMP/db/mysql56 文件夹中删除文件 ib_logfileN(N 是数字)。

Then restart MAMP.然后重新启动 MAMP。

Should Work!应该管用!

我已经使用 MAMP 4.2 版尝试了上述所有解决方案,但在 El Capitan OS 中没有一个对我有用,所以唯一有效的是使用 Clean My Mac 卸载 MAMP,然后安装旧的 3.5.2 版本,那个马上工作了。

Best way to find the real cause is to check the MAMP error log in MAMP > logs > mysql_error_log.err找到真正原因的最佳方法是检查 MAMP > 日志 > mysql_error_log.err 中的 MAMP 错误日志

I found the ERROR "Do you already have another mysql server running on port: 3306 ?"我发现错误“您是否已经在端口 3306 上运行了另一个 mysql 服务器?” - which was actually the cause for my MAMP MYSQL not starting. - 这实际上是我的 MAMP MYSQL 无法启动的原因。

Port 3306 was already "busy", so I have changed it to 8306 and that solved my issue.端口 3306 已经“繁忙”,所以我将其更改为 8306 并解决了我的问题。

None of the above answers worked for me (I did MAMP upgrade to latest 5.7 on MacOS).以上答案都不适合我(我在 MacOS 上将 MAMP 升级到最新的 5.7)。

After a while of digging through the error log ( /Applications/MAMP/logs/mysql_error_log.err ) i found out that there's an error [ERROR] unknown variable 'thread_concurrency=8'] that causes termination.经过一段时间挖掘错误日志( /Applications/MAMP/logs/mysql_error_log.err ),我发现有一个错误[ERROR] unknown variable 'thread_concurrency=8']导致终止。

Based on a post about upgrades i removed the directive from my.cnf and restarted MAMP.基于一篇关于升级的帖子,我从my.cnf删除了指令并重新启动了 MAMP。 All worked well afterwards (was prompted to upgrade DBs, etc.)之后一切正常(提示升级数据库等)

Here's what worked for me:以下是对我有用的内容:

  • Check to see if you accidentally installed mysql via Brew or something.检查您是否不小心通过 Brew 或其他方式安装了 mysql。 brew list mysql
  • Uninstall it brew uninstall mysql卸载它brew uninstall mysql
  • Try to fire up MAMP.尝试启动 MAMP。 Might need to reinstall.可能需要重新安装。
  • Eventually upgrade to Vagrant and stop fighting with MAMP.最终升级到 Vagrant 并停止与 MAMP 战斗。

What worked for me was:对我有用的是:

I had a process called "mysqld" running even when MAMP had been quit.即使 MAMP 已退出,我也有一个名为“mysqld”的进程在运行。 I force quit the process, restarted MAMP and it worked again.我强制退出该过程,重新启动 MAMP 并再次运行。

如果是 MAMP PRO,您需要在此处删除 ib_logfiles:

rm -rf /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile*

对我来说,my.cnf 中的 innodb_additional_mem_pool_size 行导致了它

I was running MAMP 4.1 on windows and MYSQL 5.7 .Was having this problem many times and found out a fix for this: For me deleting the log files was not working then just delete我在 Windows 和 MYSQL 5.7 上运行 MAMP 4.1。多次遇到这个问题并找到了解决方法:对我来说,删除日志文件不起作用,然后删除

  • mysql-bin.index mysql-bin.index
  • YOUR_PC_NAME.pid YOUR_PC_NAME.pid

and boom it starts working again.并繁荣它再次开始工作。 If this also doesn't work for your, remember to delete each file one by one and keep checking if any works for you.如果这也不适用于您,请记住一个一个删除每个文件并继续检查是否有任何适合您的文件。 Make sure to backup always.确保始终备份

I just ran this in terminal: sudo killall -9 mysqld and then I force quit MAMP.我只是在终端中运行这个: sudo killall -9 mysqld然后我强制退出 MAMP。 Reopen Mamp and everything works perfectly.重新打开 Mamp,一切正常。

Sometimes, just turning off and restarting your computer does the trick.有时,只需关闭并重新启动计算机即可解决问题。

If you are using MAMP PRO 5.7+ (18029)如果您使用的是 MAMP PRO 5.7+ (18029)

1.Just stop MAMPRO. 1. 停止 MAMPRO。 2.Goto to directory /Applications/MAMP/db/mysql## (Where ## is the Number of your Mysql version) 3.List the files with command: ls -l * 4. Type command: rm ib_logfile* #Just must delete theses 2 files. 2.转到目录/Applications/MAMP/db/mysql##(其中##是您的Mysql版本号) 3.使用命令列出文件:ls -l * 4.键入命令:rm ib_logfile* #Just must删除这两个文件。 5.Restart MAMPRO and its must works fine! 5.重新启动MAMPRO,它必须工作正常!

Caution: If you remove the files ibdata1 will destroy all you "databases"注意:如果您删除文件 ibdata1 将破坏您所有的“数据库”

This is what worked for me (Windows 10) :这对我有用(Windows 10):

  1. Click on Start Servers in MAMP单击 MAMP 中的启动服务器
  2. Manually click on mysql.exe in MAMP installation folder (C:\\MAMP\\bin\\mysql\\bin\\mysql.exe)手动点击MAMP安装文件夹中的mysql.exe(C:\\MAMP\\bin\\mysql\\bin\\mysql.exe)

Tip : You can pin mysql.exe to Start Menu so you don't always have to search for this folder提示:您可以将 mysql.exe 固定到“开始”菜单,这样您就不必总是搜索此文件夹

I have mac system and my mamp does not start properly.我有 mac 系统,但我的 mamp 无法正常启动。 Just restart my system and then start mamp again then it's working properly只需重新启动我的系统,然后再次启动 mamp 然后它就可以正常工作了

I hope it works for you我希望这个对你有用

You can try this in your terminal : rm /Applications/MAMP/db/mysql/* . 您可以在终端中尝试: rm /Applications/MAMP/db/mysql/*

It works for me. 这个对我有用。

You need to leave the mysql database AS IS.您需要按原样保留 mysql 数据库。

  • Uninstall and reinstall MAMP Pro.卸载并重新安装 MAMP Pro。
  • For every WP instance that you want to have on your server (localhost), you need to create a NEW database that is not mysql.对于您希望在服务器 (localhost) 上拥有的每个 WP 实例,您需要创建一个不是 mysql 的新数据库。
  • Go into SequelPro and add database.进入 SequelPro 并添加数据库。
  • Use Duplicator to transfer your WP.使用复印机转移您的 WP。

Do not use mysql for anything, it appears to be required by MAMP.不要将 mysql 用于任何事情,它似乎是 MAMP 所要求的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM