MAMP-Windows 上的 MySQL 服务器将无法启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/54296014/
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
MySQL Server on MAMP-Windows Will Not Start
提问by kittensneedlove
I am using MAMP 4.1 on Windows 10 and cannot get MySQL server to start. When I uninstalled MAMP and re-installed it MySQL server starts up, but when I stop it, it will not start back up. I also went into the \mamp\db\mysql\ and deleted the four log files hilited below. Then I turned the server off, then back on, but only Apache starts up, not MySQL.
我在 Windows 10 上使用 MAMP 4.1 并且无法启动 MySQL 服务器。当我卸载 MAMP 并重新安装它时,MySQL 服务器会启动,但是当我停止它时,它不会重新启动。我还进入了\mamp\db\mysql\ 并删除了下面的四个日志文件。然后我关闭服务器,然后重新打开,但只有 Apache 启动,而不是 MySQL。
There is also a process running in services called MySQL80. When I try to start it I get the error message shown. I have tried many ways to delete it, including going to the command prompt and using "sc mysql80" and going to 'regedit'. MySQL80 does not show up anywhere so that I can delete it.
还有一个进程运行在名为 MySQL80 的服务中。当我尝试启动它时,我收到显示的错误消息。我尝试了很多方法来删除它,包括进入命令提示符并使用“sc mysql80”和“regedit”。MySQL80 没有出现在任何地方,所以我可以删除它。
Also, the Resource Monitor below shows that Apache is running on port 80, but nothing on port 3306. And yes, my MAMP Preferences are set to port 3306 for MySQL.
此外,下面的资源监视器显示 Apache 在端口 80 上运行,但在端口 3306 上什么也没有。是的,我的 MAMP 首选项设置为 MySQL 的端口 3306。
When MySQL was running, I had 2 processes of 'mysqld' listening: one session on IPv6 Port 3306, and the other session on IPv4 Port 3306?
当 MySQL 运行时,我有 2 个 'mysqld' 侦听进程:一个会话在 IPv6 端口 3306 上,另一个会话在 IPv4 端口 3306 上?
What's wrong and how do I fix it?
出了什么问题,我该如何解决?
And, is there suppose to be (2) sessions of 'mysqld' both listening on port 3306 where one is on IPv6 and the other is on IPv4?
并且,是否假设有 (2) 个 'mysqld' 会话都在侦听端口 3306,其中一个在 IPv6 上,另一个在 IPv4 上?
Thanks Community.
感谢社区。
回答by nick kladis
I had the same problem. I contacted mamp support, and their answer was the following; it worked for me. Hope this helps you too. Stop all servers in MAMP.
我有同样的问题。我联系了 mamp 支持,他们的回答如下;它对我有用。希望这对你也有帮助。停止 MAMP 中的所有服务器。
The below assumes your MAMP installation directory is C:\MAMP\
.
下面假设您的 MAMP 安装目录是C:\MAMP\
.
For MAMP:
对于 MAMP:
- With Windows Explorer go to folder
C:\MAMP\db\mysql\
- First backup all files that begin with
mysql-bin.*
, then delete them (includingmysql-bin.index
file.) - Then try starting all MAMP servers again (wait for MySQL to turn light on).
- After that stop all MAMP servers again.
- You'll now try to disable binary log-bin in MAMP (or MAMP PRO)
- Open up MySQL configuration file in text editor of your choice:
C:\MAMP\conf\mysql\my.ini
- Find following text:
log-bin
- Comment this line by adding
#
character at start of line.#log-bin=mysql-bin
- Save and restart servers
- After that put the
mysql-bin.*
files back in their place.
- 使用 Windows 资源管理器转到文件夹
C:\MAMP\db\mysql\
- 首先备份所有以 开头的文件
mysql-bin.*
,然后删除它们(包括mysql-bin.index
文件。) - 然后再次尝试启动所有 MAMP 服务器(等待 MySQL 打开灯)。
- 之后再次停止所有 MAMP 服务器。
- 您现在将尝试在 MAMP(或 MAMP PRO)中禁用二进制日志
- 在您选择的文本编辑器中打开 MySQL 配置文件:
C:\MAMP\conf\mysql\my.ini
- 查找以下文本:
log-bin
- 通过在行首添加
#
字符来注释此行。#log-bin=mysql-bin
- 保存并重启服务器
- 之后,将
mysql-bin.*
文件放回原处。
回答by Donnie Patrick
- Turn off your MAMP Server.
- Locate your db folder for mysql. Example: C:\MAMP\db\mysql
- Rename the mysql-bin.index file to mysql-bin_old.index (or anything really)
- Turn on your MAMP Server
- 关闭您的 MAMP 服务器。
- 找到 mysql 的 db 文件夹。示例:C:\MAMP\db\mysql
- 将 mysql-bin.index 文件重命名为 mysql-bin_old.index(或其他任何名称)
- 打开你的 MAMP 服务器
This is a very common issue with MAMP. If this happened to you out of the blue, this is probably the fix.
这是 MAMP 的一个非常常见的问题。如果这突然发生在你身上,这可能是解决办法。
回答by kittensneedlove
my issue was Avast Antivirus blocking MAMP, disabled for 10 minutes and Apache started
我的问题是 Avast Antivirus 阻止 MAMP,禁用 10 分钟,然后 Apache 启动
回答by MrSandman98765
This is what I did to solve this issue:
这是我为解决此问题所做的工作:
- Quit MAMP if open
- Navigate to /MAMP/tmp/mysql
- Rename mysql.sock.lock
- Restart MAMP
- 如果打开则退出 MAMP
- 导航到 /MAMP/tmp/mysql
- 重命名 mysql.sock.lock
- 重启 MAMP
回答by stormfield
I had the same problem today.
I did try removing everything from C:\MAMP\db\mysql\
and tried to restart MAMP & servers. But it failed.
我今天遇到了同样的问题。我确实尝试从中删除所有内容C:\MAMP\db\mysql\
并尝试重新启动 MAMP 和服务器。但它失败了。
Then I noticed the following error in the mysql log file /MAMP/logs/mysql_error_log.err
然后我注意到mysql日志文件中有以下错误 /MAMP/logs/mysql_error_log.err
[error] Cannot open windows event_log ; check privileges
[error] Cannot open windows event_log ; check privileges
This basically means that you don't have sufficient access.
这基本上意味着您没有足够的访问权限。
So
所以
- I replaced all the files that I originally deleted
- shutdown the server & MAMP.
- Now right click on the MAMP icon & choose
run as administrator
- Now it starts up normally
- 我替换了我最初删除的所有文件
- 关闭服务器和 MAMP。
- 现在右键单击 MAMP 图标并选择
run as administrator
- 现在它正常启动
回答by SohaibAbbas
Uninstall entire MAMP and also any other xamap and wamp if you install previously. Check the drive C. No any other folder or file related to this present there. then reinstall MAMP again. All the problems are solve your apache and mysql both start. please vote me.
如果您之前安装过,请卸载整个 MAMP 以及任何其他 xamap 和 wamp。检查驱动器 C。那里没有与此相关的任何其他文件夹或文件。然后再次重新安装 MAMP。所有的问题都解决了你的 apache 和 mysql 都启动。请投票给我。