MySQL 将 mamp 端口设置为 80 和 3306

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9371538/
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 12:12:24  来源:igfitidea点击:

setting mamp ports to 80 and 3306

mysqlapachedreamweavermamp

提问by thebiglebowski11

I have both apache and mySQL running with the default MAMP ports (8888 and 8889 respectively) and everything seems to work, but when I switch the ports to 80 for Apache and 3306 for mySQL, the mySQL server is unable to restart.

我同时使用默认 MAMP 端口(分别为 8888 和 8889)运行 apache 和 mySQL,一切似乎都正常,但是当我将端口切换到 Apache 的 80 和 mySQL 的 3306 时,mySQL 服务器无法重新启动。

I am trying to setup MAMP to run on these ports because apparently this is optimal for developing in dreamweaver... Thus, given that I would like to have the ideal dev environment for dreamweaver, is there a way around using the 3306 port? Or, what could the potential problems be?

我正在尝试设置 MAMP 以在这些端口上运行,因为显然这对于​​在 Dreamweaver 中进行开发来说是最佳的......因此,鉴于我希望为 Dreamweaver 提供理想的开发环境,有没有办法绕过 3306 端口?或者,潜在的问题是什么?

Thanks

谢谢

回答by thebiglebowski11

Just in case anyone is having the same problem, here is how I fixed it:

以防万一有人遇到同样的问题,这是我修复它的方法:

I opened the Activity Monitor program and selected "All Processes"
Next I search for "mysqld" in the search text field. There is a good chance that you have an instance of mysql running and you have to find it and hit quit process.
Restart MAMP and you should be all set.

我打开了活动监视器程序并选择了“所有进程”
接下来我在搜索文本字段中搜索“mysqld”。很有可能你有一个 mysql 正在运行的实例,你必须找到它并点击退出过程。
重新启动 MAMP,你应该一切都准备好了。

回答by mazal

i posted my solution here..but will it annoy the editor gods to re-post? i found this works so clearly and consistently that it's worth evangelizing.

我在这里发布了我的解决方案..但是重新发布会惹恼编辑之神吗?我发现这非常清晰和一致,值得宣传。

fix courtesy of Abhinav Sood.

修复由Abhinav Sood 提供

  1. Launch MAMP. Open Terminal by typing terminal into Spotlight (Command + Space).

  2. Open MAMP Preferences (Command + , ) and click on Reset MAMP Ports (Port 8888 and Port 8889 for Apache and MySQL respectively). Click on OK.

  3. Switch to the terminal. Type sudo apachectl stopto shutdown the system Apache.

  4. Restart MAMP.

  5. Open MAMP Preferences once again and click on Set to Default Apache and MySQL ports. This will set the Apache and MySQL ports to 80 and 3306 respectively.

  6. Switch to the terminal. Type sudo apachectl restartto restart Apache.

  7. Switch back to MAMP and click on Open Start Page (or go to http://localhost/MAMP/?language=Englishin your browser)

  1. 启动 MAMP。通过在 Spotlight (Command + Space) 中输入终端来打开终端。

  2. 打开 MAMP 首选项(Command + , )并单击重置 MAMP 端口(Apache 和 MySQL 分别为端口 8888 和端口 8889)。单击确定。

  3. 切换到终端。键入sudo apachectl stop以关闭系统 Apache。

  4. 重新启动 MAMP。

  5. 再次打开 MAMP Preferences,然后单击 Set to Default Apache 和 MySQL 端口。这会将 Apache 和 MySQL 端口分别设置为 80 和 3306。

  6. 切换到终端。键入sudo apachectl restart以重新启动 Apache。

  7. 切换回 MAMP 并单击打开起始页(或http://localhost/MAMP/?language=English在浏览器中转到)

And you're done.

你已经完成了。

回答by Francisco Albert

I configured httpd.conf. In that file just replace:

我配置了httpd.conf。在该文件中只需替换:

Listen 80

听 80

for

为了

Listen localhost:80

听本地主机:80

restart mamp. It worked for me.

重启mamp。它对我有用。

回答by Damien Chan

@Mazal

@马扎尔

Finally I found your great great solution of fixing this localhost:80 and apachectl issue. However, the issue will resume back when after re-start against!!!!!!

最后,我找到了您解决此 localhost:80 和 apachectl 问题的绝佳解决方案。但是,重新启动后问题会恢复!!!!!!!

So fix this goto perference-->when quiting MAMP--> [uncheck] the box stop server.

因此,请修复此转到偏好-->退出 MAMP 时--> [取消选中] 框停止服务器。

this will keep the port setting to localhost:80 and apachectl in green light.

这将使端口设置保持为 localhost:80 并且 apachectl 处于绿灯状态。

cheers!

干杯!