php MySQL 数据库无法在 XAMPP for Mac 上启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27835348/
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 Database cannot start on XAMPP for Mac
提问by Raaj Lokanathan
All of a sudden I am encountering this problem on my mac. I cant start my MySQL Database. I can only start my ProFTPD and Apache Web Server.
突然间,我在我的 mac 上遇到了这个问题。我无法启动我的 MySQL 数据库。我只能启动我的 ProFTPD 和 Apache Web 服务器。
This is the application log:
这是应用程序日志:
Starting all servers...
Starting MySQL Database...
Starting Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started
Starting ProFTPD...
Checking syntax of configuration file
/Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd started
I have even did some research through stackoverflow. First i tried to end the process through my activity monitor by i couldnt find the keyword sql on the filter search area. The second method i tried was adding the unset DYLD_LIBRARY_PATH
but that didnt even worked for me.
我什至通过 stackoverflow 做了一些研究。首先,我尝试通过我的活动监视器结束该过程,因为我在过滤器搜索区域找不到关键字 sql。我尝试的第二种方法是添加unset DYLD_LIBRARY_PATH
但这对我来说甚至不起作用。
Can i know how to solve this problem. Helps would be really appreciated. Thank you
我可以知道如何解决这个问题。帮助将不胜感激。谢谢
回答by Shailesh Dwivedi
#1. Open XAMPP Installation Directory
#2. Open "etc" Folder
#3. Find "my.cnf" file and open it in any text editor
#4. Change Port from 3306 to 3307 (if you have installed skype or other apps)
#5. Add "innodb_force_recovery=1" under "myisam_sort_buffer_size=8M"
#6. Save "my.cnf" file
#7. Restart Mysql Server By Your Terminal by command:
"sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start"
You Get A message "Starting MySQL SUCCESS! "
回答by Aamir Mahmood
For me, Xampp Control panel was not launching, and in Stackoverflow some where it was mentioned to add Read / Write for every one on every file of xampp, when I did that. It allowed me to launch xampp control panel but mysql was not starting.
对我来说,Xampp 控制面板没有启动,在 Stackoverflow 中,有人提到要为 xampp 的每个文件上的每个文件添加读/写,当我这样做时。它允许我启动 xampp 控制面板,但 mysql 没有启动。
Later I debuged and found that /Applications/XAMPP/xamppfiles/etc/my.cnf
should not be writeable by everyone, mysql will ignore my.cnf if it is for everyone. I changed the permission to read only for this file, and able to start mysql server
后来我调试发现/Applications/XAMPP/xamppfiles/etc/my.cnf
应该不是每个人都可以写的,mysql如果是每个人都会忽略my.cnf。我改变了这个文件的只读权限,并且能够启动mysql服务器
回答by Raaj Lokanathan
I just solve the answer by going to the activity monitor and search for sql under all process and terminate it. then i restart my mac and now my sql database is working great for me.
我只是通过转到活动监视器并在所有进程下搜索 sql 并终止它来解决答案。然后我重新启动我的 mac,现在我的 sql 数据库对我来说很好用。
回答by CruzBaggio
I Know this post was originally posted last year, but I just had the same problem and I found the solution for me. So here it is, just in case this can help somebody else.
我知道这篇文章最初是去年发布的,但我遇到了同样的问题,我找到了适合我的解决方案。所以在这里,以防万一这可以帮助其他人。
I tried all the suggestions I found online, including trying to terminate MySQL on the activity monitor, but then I realized that when you download/upgrade XAMPP - MySQL, the option to automatically start MySQLserver on Startup is ON. You need to turn it off. Here is what you do:
我尝试了我在网上找到的所有建议,包括尝试在活动监视器上终止 MySQL,但后来我意识到当您下载/升级 XAMPP - MySQL 时,在启动时自动启动 MySQLserver 的选项是 ON 的。你需要把它关掉。这是你要做的:
Go System Preferencesand click on the Mysql icon, You should get this window:
转到系统偏好设置并单击 Mysql 图标,您应该会看到以下窗口:
Uncheck that option. You will be asked for your password. After you are done with that, restart your computer and the problem should be fixed.
取消选中该选项。系统会要求您输入密码。完成后,重新启动计算机,问题应该得到解决。
I hope that help somebody who is as confused as I was. lol ?
我希望能帮助像我一样困惑的人。哈哈 ?
回答by Kunal
Xampp Control Panel> Manage Server> Mysql Database > Configure > change the port from 3306 to 3307
Xampp控制面板>管理服务器>Mysql数据库>配置>将端口从3306改为3307
At least it worked for me in mac.
至少它在 mac 中对我有用。
回答by ABODE
If mysql is not starting in xampp, it might be a port conflict issue. Mysql run by default on port 3306. you need to check if another application is occupying that port. use following command to check app occupying a port
如果 mysql 未在 xampp 中启动,则可能是端口冲突问题。Mysql 默认运行在 3306 端口。您需要检查是否有其他应用程序占用了该端口。使用以下命令检查应用程序占用端口
lsof -nP -i4TCP:3306
if you find an application occupying that port, stop the application and restart xampp. As an alternative, you can go to php.ini file or click configure in the dropdown and change the mysql port to 3307
如果您发现某个应用程序占用了该端口,请停止该应用程序并重新启动 xampp。或者,您可以转到 php.ini 文件或单击下拉列表中的配置并将 mysql 端口更改为 3307
回答by Anand Chaudhary
I spent whole day trying to resolve this issue. Changing the port no from 3306 to 3307 worked for me. Simply open the configure module and change the port number. Hope it works for you.
我花了一整天的时间试图解决这个问题。将端口号从 3306 更改为 3307 对我有用。只需打开配置模块并更改端口号。希望对你有效。