php MySQL 数据库不会在 XAMPP Manager-osx 中启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21267064/
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 won't start in XAMPP Manager-osx
提问by nitrous
I downloaded XAMPP about a month ago and it was working just fine. Today I installed a voice recognition software and then restarted my computer. Ever since, MySQL won't start in my manager-osx application. It doesn't throw me an in the application log. This is what it says:
我大约一个月前下载了 XAMPP,它运行得很好。今天我安装了一个语音识别软件,然后重新启动了我的电脑。从那以后,MySQL 不会在我的 manager-osx 应用程序中启动。它不会在应用程序日志中抛出我。这就是它所说的:
Stopping all servers...
Stopping Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped
Stopping ProFTPD...
Checking syntax of configuration file
/Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd stopped
Restarting 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
Both my ProFTPD and my Apache Web Server are running. MySQL isn't. When I go to phpmyadmin, it throws me this error message.
我的 ProFTPD 和我的 Apache Web 服务器都在运行。MySQL 不是。当我转到 phpmyadmin 时,它向我抛出此错误消息。
#2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured).
Please help me. I have no idea what to do.
请帮我。我不知道该怎么做。
UPDATE:
更新:
After looking around the internet a bit, I found a similar problem a user had with MAMP, another user recommended killing the mysql process, what ever that means. Could this be a fix to my problem?
在上网查了一下之后,我发现一个用户在使用 MAMP 时遇到了类似的问题,另一个用户建议杀死 mysql 进程,这意味着什么。这可以解决我的问题吗?
UPDATE 2:
更新 2:
I found the answer to my problem but I can't answer it yet. So here's the answer:
我找到了问题的答案,但我还不能回答。所以这是答案:
1) Open terminal and type
1)打开终端并输入
sudo su
and then put in your password
然后输入你的密码
2) Then type
2)然后输入
ps aux | grep mysql
(just copy and paste this)
(只需复制并粘贴此内容)
3) You will need to get the process id of mysql. There should be number near the top, something like 739 or 8827
3) 您需要获取 mysql 的进程 ID。顶部附近应该有数字,例如 739 或 8827
4) Kill the process using
4)使用杀死进程
kill -9 {process id}
this should look something like this: kill -9 739
这应该是这样的:kill -9 739
5) Restart MySQL in manager-osx
5)在manager-osx中重启MySQL
回答by benshittu
This should work:sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
这应该有效:sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
回答by Geoffrey Hale
Minimal Guide
最小指南
1.
sudo killall mysqld
1.
sudo killall mysqld
2. manager-osx > start mysql
2.manager-osx > 启动mysql
If that didn't work...
如果那不起作用...
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Google the error...
谷歌错误...
Examples:
例子:
Error:
错误:
ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/<computername>.local.pid)
ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/<computername>.local.pid)
My Solution:
我的解决方案:
In /Applications/XAMPP/xamppfiles/etc/my.cnfchange user = <uid>s that <uid>is uidfrom idcommand.
在/Applications/XAMPP/xamppfiles/etc/my.cnf变化user = <uid>s表示<uid>是uid从id命令。
$ id
uid=...
$ vim /Applications/XAMPP/xamppfiles/etc/my.cnf
...
回答by mondieki
If these commands don't work for you:
如果这些命令对您不起作用:
sudo killall mysqld
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Try this:
尝试这个:
For XAMPP 7.1.1-0, I changed the port number from 3306 to 3307.
对于 XAMPP 7.1.1-0,我将端口号从 3306 更改为 3307。
- Click on Manage Servers
- Select MySQL Database
- Click on Configureon your right
- Change your port number to 3307
- Click OK
- Close your Control Panel and relaunch it.
- 点击管理服务器
- 选择MySQL 数据库
- 点击右侧的配置
- 将您的端口号更改为 3307
- 单击确定
- 关闭控制面板并重新启动它。
You are now good to go.
你现在可以走了。
回答by leungxd
check the err log on your /Applications/XAMPP/xamppfiles/var/mysql/ with filename like your_machine_name.local.err, if you find something like: "Attempted to open a previously opened tablespace. Previous tablespace ... uses space ID"
检查 /Applications/XAMPP/xamppfiles/var/mysql/ 上的 err 日志,文件名类似于 your_machine_name.local.err,如果您发现以下内容:“尝试打开以前打开的表空间。以前的表空间...使用空间 ID”
the following works for me:
以下对我有用:
edit file:
编辑文件:
/Applications/XAMPP/xamppfiles/etc/my.cnf
/Applications/XAMPP/xamppfiles/etc/my.cnf
find the [mysqld] section, add one line:
找到 [mysqld] 部分,添加一行:
innodb_force_recovery = 1
innodb_force_recovery = 1
then run
然后运行
sudo /Applications/XAMPP/bin/mysql.server start
须藤/Applications/XAMPP/bin/mysql.server 启动
everything is ok again.
一切正常。
and then the last step:
然后是最后一步:
edit the my.cnf again and remove the line you just added :
再次编辑 my.cnf 并删除您刚刚添加的行:
innodb_force_recovery = 1
innodb_force_recovery = 1
and restart mysql again. Otherwise all your tables will be read only
并再次重新启动mysql。否则你所有的表都将是只读的
回答by wishab
For me the following worked: Change permission into 'read only' for 'everyone' to the file /Applications/XAMPP/xamppfiles/etc/my.cnf. Then start MySQL from XAMPP manager.
对我来说,以下工作有效:将文件的“所有人”的权限更改为“只读” /Applications/XAMPP/xamppfiles/etc/my.cnf。然后从 XAMPP 管理器启动 MySQL。
回答by Golam Sorwar
Try running these two commands in the terminal:
尝试在终端中运行这两个命令:
sudo killall mysqld sudo/Applications/XAMPP/xamppfiles/bin/mysql.server start
sudo killall mysqld sudo/Applications/XAMPP/xamppfiles/bin/mysql.server start
回答by sgo
I first couldn't manage to kill mysql daemon with the commands posted here. So I remembered my linux times and did the following:
我首先无法使用此处发布的命令杀死 mysql 守护进程。所以我想起了我的 linux 时代并做了以下事情:
I monitored the running processes by running topin one terminal window. Then I killed mysqld via sudo killall mysqld(screw the PID ;-) ) in another and restarted via sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start.
我通过top在一个终端窗口中运行来监视正在运行的进程。然后我sudo killall mysqld在另一个中通过(拧紧 PID ;-) )杀死了 mysqld并通过sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start.
回答by HuanHuang
it happened to me. and
它发生在我身上。和
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
not work for me.
不适合我。
so, i reinstall the xampp, then fix it.
所以,我重新安装了 xampp,然后修复它。
attention:
注意力:
reinstall the xampp, will not delete mysql data, no need to worry about that.
重新安装xampp,不会删除mysql数据,不用担心。
回答by Tung Nguyen
- close XAMPP control
- sudo killall mysqld
- sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
- 关闭 XAMPP 控制
- 须藤killall mysqld
- 须藤/Applications/XAMPP/xamppfiles/bin/mysql.server 启动
回答by Spin Rodriguez
There's been a lot of answer, but I think I found what is causing it, at least for me. It looks like if you put your computer to sleep (or it falls asleep on its own), when it reopens, it tries to open the the mysql process again. At one point I looked at my activity monitor and I had 5 instances running - killing all of them and then starting mysql works.
有很多答案,但我想我找到了导致它的原因,至少对我来说是这样。看起来如果你让你的计算机进入睡眠状态(或者它自己进入睡眠状态),当它重新打开时,它会尝试再次打开 mysql 进程。有一次,我查看了我的活动监视器,我有 5 个实例正在运行 - 杀死所有实例,然后启动 mysql 工作。

