Xampp 不会在 Mac OSX 上启动 MySQL 服务器吗?

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

Xampp Won't Startup MySQL server on Mac OSX?

mysqlmacososx-lionxampp

提问by jaycodez

I'm on a Mac OSX Mountain Lion. Xampp won't let me start MySQL server.

我在 Mac OSX Mountain Lion 上。Xampp 不会让我启动 MySQL 服务器。

I have set the permissions to Read/Write for everyone and every file in the XAMPP folder.

我已经为 XAMPP 文件夹中的每个人和每个文件设置了读/写权限。

enter image description here

在此处输入图片说明

The error message shows "The operation couldn't be completed. (XAMPPErrorDomain error 1.)"

错误消息显示“无法完成操作。(XAMPPErrorDomain 错误 1。)”

Any ideas on how to stop other MySQL processes. I have tried following this Lynda.com Tutorial on fixing port conflicts. I tried typing in this command "sudo lsof -i -P | grep 3306" in Terminal.

关于如何停止其他 MySQL 进程的任何想法。我已经尝试按照这个 Lynda.com 教程修复端口冲突。我尝试在终端中输入此命令“sudo lsof -i -P | grep 3306”。

However it didn't work, I wanted to test to see if MySQL is running however nothing returned. How can I check to see if any other versions are running, then stop any other MySQL servers/ Uninstall the other possible version?

但是它不起作用,我想测试一下 MySQL 是否正在运行,但没有返回任何内容。如何检查是否有其他版本正在运行,然后停止任何其他 MySQL 服务器/卸载其他可能的版本?

Here is the error Log Screenshot? Is that what you were looking for? enter image description here

这是错误日志截图?这就是你要找的吗? 在此处输入图片说明

enter image description here

在此处输入图片说明

Here is the error Log:

这是错误日志:

[Tue Dec 11 10:46:28 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Dec 11 10:46:29 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 11 10:46:29 2012] [notice] Digest: done
[Tue Dec 11 10:46:29 2012] [notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Dec 11 11:00:02 2012] [notice] caught SIGTERM, shutting down
[Tue Dec 11 11:00:33 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Dec 11 11:00:34 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 11 11:00:34 2012] [notice] Digest: done
[Tue Dec 11 11:00:34 2012] [notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Dec 11 14:14:23 2012] [notice] caught SIGTERM, shutting down
[Tue Dec 11 14:17:31 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Dec 11 14:17:32 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 11 14:17:32 2012] [notice] Digest: done
[Tue Dec 11 14:17:32 2012] [notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory
sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory
[Tue Dec 11 16:07:41 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/jessleigh/wp-admin/function.unlink, referer: http://localhost/jessleigh/wp-admin/admin.php?page=functions.php
[Tue Dec 11 16:41:51 2012] [notice] caught SIGTERM, shutting down
[Tue Dec 11 17:08:44 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Dec 11 17:08:45 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 11 17:08:45 2012] [notice] Digest: done
[Tue Dec 11 17:08:45 2012] [notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Dec 11 17:38:02 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/xampp/jessleigh
[Tue Dec 11 17:57:29 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/xampp/jessleigh
[Tue Dec 11 17:57:39 2012] [notice] caught SIGTERM, shutting down
[Tue Dec 11 17:57:44 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Dec 11 17:57:45 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 11 17:57:45 2012] [notice] Digest: done
[Tue Dec 11 17:57:45 2012] [notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Dec 11 17:57:46 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/xampp/jessleigh
[Tue Dec 11 17:57:47 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/xampp/jessleigh
[Tue Dec 11 17:58:01 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/xampp/jessleigh
[Tue Dec 11 19:57:16 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/jessleigh/sample-page, referer: http://localhost/jessleigh/
[Tue Dec 11 20:07:09 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/jessleigh/sample-page, referer: http://localhost/jessleigh/
[Tue Dec 11 20:31:33 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/xamppfiles/htdocs/jessleigh/home, referer: http://localhost/jessleigh/wp-admin/post.php?post=41&action=edit&message=6
[Fri Dec 14 13:15:33 2012] [notice] caught SIGTERM, shutting down
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[Fri Dec 14 18:20:53 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Dec 14 18:20:54 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 14 18:20:54 2012] [notice] Digest: done
[Fri Dec 14 18:20:54 2012] [notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Dec 14 18:24:24 2012] [notice] caught SIGTERM, shutting down
[Tue Dec 18 12:00:06 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Dec 18 12:00:07 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 18 12:00:07 2012] [notice] Digest: done
[Tue Dec 18 12:00:07 2012] [notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
:

回答by Max

you can check if any instance of mysql is running by executing in the terminal

您可以通过在终端中执行来检查是否有任何 mysql 实例正在运行

sudo ps aux | grep mysql

this will list any processes that have mysql in their name.

这将列出名称中包含 mysql 的所有进程。

_mysql          18943   0,0  0,5  2514608  20340 s008  S+    5:46am   0:00.07   /opt/local/libexec/mysqld --basedir=/opt/local --datadir=/opt/local/var/db/mysql5 --  user=_mysql --log-error=/opt/local/var/db/mysql5/Max-NB.local.err --pid-  file=/opt/local/var/db/mysql5/Max-NB.local.pid
root            18900   0,0  0,1  2439964   2592 s008  S+    5:46am   0:00.15 /bin/sh   /opt/local/bin/mysqld_safe5
root            18899   0,0  0,1  2439396   2616 s008  S+    5:46am   0:00.02 sudo   mysqld_safe5

you may then terminate the process by executing

然后你可以通过执行来终止进程

sudo killall mysqld_safe5

you should replace "mysqld_safe5" by the name of your mysql process. It is most likely "mysqld".

您应该用您的 mysql 进程的名称替换“mysqld_safe5”。它很可能是“mysqld”。

After that you could try to restart your server and check if it works.

之后,您可以尝试重新启动服务器并检查它是否有效。

回答by palaniraja

chmod -R 777 /Applications/XAMPP/xamppfiles/var

fixed the problem for me. Refer - StackOverflow question

为我解决了问题。参考 - StackOverflow 问题

However do notdo this in production servers, you may need to change the owner or group (chownor chgrpto resolve the problem.

但是也不会在生产服务器做到这一点,你可能需要更改所有者或组(chownchgrp解决该问题。

回答by Varun Bajaj

First read the error file located at /Applications/XAMPP/xamppfiles/logs/error_log, normally this error occurs if something is running on port 3306 already.

首先读取位于/Applications/XAMPP/xamppfiles/logs/error_log的错误文件,如果某些内容已经在端口 3306 上运行,通常会发生此错误。

回答by Muneef Hameed

I had the same problem, but managed to solve it by replacing my.cnf with the original file. It had the following line coming removing which solved the problem.

我遇到了同样的问题,但设法通过用原始文件替换 my.cnf 来解决它。它删除了以下行,解决了问题。

listen 80

回答by CTLaur

You should try to configure your MySql Database and change you port from 3306 to 3307 , this work for me . Sometimes this port is busy and does not work for your pc.

您应该尝试配置您的 MySql 数据库并将您的端口从 3306 更改为 3307,这对我有用。有时这个端口很忙,对你的电脑不起作用。

回答by Stanley Wang

looks into the error log and you may find:

查看错误日志,您可能会发现:

[ERROR] Bad magic header in tc log
[ERROR] Can't init tc log

[错误] tc 日志中的魔术头
错误 [错误] 无法初始化 tc 日志

delete /Applications/XAMPP/xamppfiles/var/mysql/tc.log and restart the mysql

删除 /Applications/XAMPP/xamppfiles/var/mysql/tc.log 并重新启动 mysql