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

Posted

技术标签:

【中文标题】Xampp 不会在 Mac OSX 上启动 MySQL 服务器?【英文标题】:Xampp Won't Startup MySQL server on Mac OSX? 【发布时间】:2012-12-15 08:45:43 【问题描述】:

我使用的是 Mac OSX Mountain Lion。 Xampp 不允许我启动 mysql 服务器。

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

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

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

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

这是错误日志截图?那是你要找的吗?

这是错误日志:

[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
:

【问题讨论】:

tail -2 /opt/lampp/logs/error_log @JonathandeM。嘿,我使用的是 Xampp 而不是 Lampp?无论如何我将如何使用该命令? tail -2 /opt/xampp/logs/error_log,使用自动补全,我不确定路径 error_log 是 apache 错误日志。 Mysql 错误日志应该是 .err 不知道 xampp 中的路径。我使用 AMPPS。 【参考方案1】:

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

sudo ps aux | grep mysql

这将列出所有名称中包含 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

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

sudo killall mysqld_safe5

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

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

【讨论】:

为什么是sudo ps aux 而不仅仅是ps aux 我从屏幕截图中看到您试图通过将日志文件的名称粘贴到终端来查看您的 error.log。通过执行此 bash 假设您正在该路径上运行脚本。尝试运行“less /Applications/XAMPP/xamppfiles/logs/error_log” @WaleedKhan 它应该在没有 sudo 的情况下也可以工作,但是我不知道它是否会在以普通用户身份运行时显示根进程。 @MaxI 上传了一个屏幕截图,我不确定如何终止该进程? 正确的答案是重新安装 Xampp 并重新启动,但这是最接近的。 :)【参考方案2】:
chmod -R 777 /Applications/XAMPP/xamppfiles/var

为我解决了这个问题。参考-*** question

但是在生产服务器中执行此操作,您可能需要更改所有者或组(chownchgrp 以解决问题。

【讨论】:

谢谢哥们,你的解决方案也解决了我的问题:)。 这也解决了我的问题。谢谢。【参考方案3】:

首先读取位于/Applications/XAMPP/xamppfiles/logs/error_log的错误文件,通常如果端口3306上已经有东西在运行,就会出现这个错误。

【讨论】:

我打开了那个文件并在终端中对其进行了截图,并在上面添加了如何查看error_log? 请检查您是否已将您的 XAMPP 文件夹放在根文件夹中,例如/Applications,如果您已将您的 xampp 文件夹放在根文件夹以外(嵌套到某个级别,例如 (/Applications/abc/xampp)有时它会造成问题。 是的,它肯定在根文件夹中。【参考方案4】:

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

listen 80

【讨论】:

【参考方案5】:

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

【讨论】:

您知道最初的问题是在 2012 年发布的,对吧?【参考方案6】:

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

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

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

【讨论】:

【参考方案7】:

你可以在你的 Mac book 上使用 MAMP PRO。但是有一个问题,如果你没有注册或激活它只会工作 14 天。

我在这里分享一些截图...

1.安装好后,打开并选择phpMyAdmin1

2.接下来你去Database2

3.然后你可以创建数据库,你可以在那里添加列3

【讨论】:

这个问题是 8 年前的问题。而答案只是没有回答问题(请求更改软件并不是解决某些软件问题的方法)。

以上是关于Xampp 不会在 Mac OSX 上启动 MySQL 服务器?的主要内容,如果未能解决你的问题,请参考以下文章

Applescript启动XAMPP osx,弹出时不会输入密码?

MySQL 不在 mac osx 中的 xampp 中启动

Xampp 无法在 Mac X 上运行

如何在mac osx下启用mysql(转载)

更新到 mac High Sierra 10.13.2 后 MySQL 服务器不会在 MAMP/AMPPS/XAMPP 上启动

在 Mac 上的 XAMPP 上安装 PHP 国际化扩展 (Intl)