简体   繁体   English

MySQL 数据库不会在 XAMPP Manager-osx 中启动

[英]MySQL Database won't start in XAMPP Manager-osx

I downloaded XAMPP about a month ago and it was working just fine.我大约一个月前下载了 XAMPP,它运行得很好。 Today I installed a voice recognition software and then restarted my computer.今天我安装了一个语音识别软件,然后重新启动了我的电脑。 Ever since, MySQL won't start in my manager-osx application.从那以后,MySQL 不会在我的 manager-osx 应用程序中启动。 It doesn't throw me an in the application log.它不会在应用程序日志中抛出我。 This is what it says:这就是它所说的:

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.我的 ProFTPD 和我的 Apache Web 服务器都在运行。 MySQL isn't. MySQL 不是。 When I go to phpmyadmin, it throws me this error message.当我转到 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.在上网查了一下之后,我发现一个用户在使用 MAMP 时遇到了类似的问题,另一个用户建议杀死 mysql 进程,这意味着什么。 Could this be a fix to my problem?这可以解决我的问题吗?

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. 3) 您需要获取 mysql 的进程 ID。 There should be number near the top, something like 739 or 8827顶部附近应该有数字,例如 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

这应该有效:
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

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

Google the error...谷歌错误...


Examples:例子:

Error:错误:

ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/<computername>.local.pid)

My Solution:我的解决方案:

In /Applications/XAMPP/xamppfiles/etc/my.cnf change user = <uid> s that <uid> is uid from id command./Applications/XAMPP/xamppfiles/etc/my.cnf更改user = <uid> s <uid>是来自id命令的uid

$ id
uid=...

$ vim /Applications/XAMPP/xamppfiles/etc/my.cnf
...

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。

  1. Click on Manage Servers点击管理服务器
  2. Select MySQL Database选择MySQL 数据库
  3. Click on Configure on your right点击右侧的配置
  4. Change your port number to 3307将您的端口号更改为 3307
  5. Click OK单击确定
  6. Close your Control Panel and relaunch it.关闭控制面板并重新启动它。

You are now good to go.你现在可以走了。

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.并再次重新启动mysql。 Otherwise all your tables will be read only否则你所有的表都将是只读的

I've tried all these methods with no luck (including of course rebooting) but when I 我尝试了所有这些方法没有运气(包括当然重启)但是当我

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

I simply get: 我得到:

Starting MySQL
. ERROR! 

Not exactly the most helpful information! 不完全是最有用的信息!

尝试在终端中运行这两个命令:

  1. sudo killall mysqld
  2. sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

For me the following worked: Change permission into 'read only' for 'everyone' to the file /Applications/XAMPP/xamppfiles/etc/my.cnf .对我来说,以下工作有效:将“所有人”的权限更改为“只读”到文件/Applications/XAMPP/xamppfiles/etc/my.cnf Then start MySQL from XAMPP manager.然后从 XAMPP 管理器启动 MySQL。

I first couldn't manage to kill mysql daemon with the commands posted here.我首先无法使用此处发布的命令杀死 mysql 守护进程。 So I remembered my linux times and did the following:所以我想起了我的 linux 时代并做了以下事情:

I monitored the running processes by running top in one terminal window.我通过在一个终端窗口中运行top来监视正在运行的进程。 Then I killed mysqld via sudo killall mysqld (screw the PID ;-) ) in another and restarted via sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start .然后我通过sudo killall mysqld (拧PID ;-))在另一个中杀死了mysqld,并通过sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start重新sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

  1. close XAMPP control关闭 XAMPP 控制
  2. sudo killall mysqld须藤killall mysqld
  3. sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start须藤/Applications/XAMPP/xamppfiles/bin/mysql.server 启动

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数据,不用担心。

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.看起来如果你让你的计算机进入睡眠状态(或者它自己进入睡眠状态),当它重新打开时,它会尝试再次打开 mysql 进程。 At one point I looked at my activity monitor and I had 5 instances running - killing all of them and then starting mysql works.有一次,我查看了我的活动监视器,我有 5 个实例正在运行 - 杀死所有实例,然后启动 mysql 工作。

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start    

这对我有用。

I had success with easy killing all active mysql processes in Monitor Activity tool:我成功地在 Monitor Activity 工具中轻松杀死了所有活动的 mysql 进程:

1) close XAMPP control 1)关闭XAMPP控件

2) open Monitor Activity 2)打开监控活动

3) select filter for All processes (default is My processes) 3)为所有进程选择过滤器(默认为我的进程)

4) search for: mysql 4)搜索:mysql

5) force quit all the mysql 5)强制退出所有的mysql

6) relaunch XAMPP control and launch apache again 6) 重新启动 XAMPP 控件并再次启动 apache

Enjoy享受

从终端尝试这两行

  1. sudo killall mysqld
  2. sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

It can cause because of the software you installed or may be any other software which is using the same port 3306. This 3306 port is used by the Mysql in XAMPP.这可能是由于您安装的软件或使用相同端口 3306 的任何其他软件。此 3306 端口由 XAMPP 中的 Mysql 使用。 Similar kind of problem I faced for Apache.我在 Apache 中遇到的类似问题。 I was running skype and trying to run the XAMPP but the skype uses the same port as Apache so it was not working.我正在运行 Skype 并尝试运行 XAMPP,但 Skype 使用与 Apache 相同的端口,因此无法正常工作。 Then I sign out from skype then the port was free and the apache started.然后我从Skype注销然后端口是免费的并且apache启动了。 So you should look for the software in you laptop which is blocking or making busy this port.因此,您应该在笔记本电脑中查找阻止或占用此端口的软件。 Free that port by closing the software and then run XAMPP and It will work.通过关闭软件释放该端口,然后运行 ​​XAMPP,它将工作。

What I did was the following: In XAMPP Control Panel I edited the my.ini file of configuration of MySql and changed the port from 3306 to 3307 and it worked, hope it helped!我所做的是以下内容:在 XAMPP 控制面板中,我编辑了 MySql 配置的 my.ini 文件并将端口从 3306 更改为 3307 并且它起作用了,希望它有所帮助!

Edit: after you save this changes be sure that the service is off and then restart the service.编辑:保存此更改后,请确保服务已关闭,然后重新启动服务。 I had this same problem when I installed MySQL, it's just the port.我在安装 MySQL 时遇到了同样的问题,这只是端口。

I encountered this problem just now.我刚才遇到了这个问题。 I checked log file and found it is caused by the server was not shutdown correctly.我检查了日志文件,发现它是由服务器没有正确关闭引起的。 So I found this http://rivenlinux.info/how-to-recover-innodb-corruption-for-mysql/ and add a simple configuration "innodb_force_recovery = 1" in [mysqld] in my.cnf.所以我找到了这个http://rivenlinux.info/how-to-recover-innodb-corruption-for-mysql/,并在my.cnf的[mysqld]中添加了一个简单的配置“innodb_force_recovery = 1”。 Then the problem was solved.然后问题就解决了。

The log file is located /Applications/XAMPP/xamppfiles/var/mysql and it named accroding to your server name.日志文件位于 /Applications/XAMPP/xamppfiles/var/mysql 并根据您的服务器名称命名。 Just link this XXX-MacBook-Pro.local.err只需链接此 XXX-MacBook-Pro.local.err

All the answers stated above in relation to changing the port number are in this situation the best way to solve this problem since you need your voice recognition software to coexist with MAMP.上面关于更改端口号的所有答案都是在这种情况下解决此问题的最佳方法,因为您需要语音识别软件与 MAMP 共存。 However, you must remember that changing this port number is going to affect all you subsequent connections to MySQL (ie, terminal,php code,phpmyadmin,etc).但是,您必须记住,更改此端口号将影响您与 MySQL 的所有后续连接(即终端、php 代码、phpmyadmin 等)。 Hence It would be advisable to change the port on which the voice recognition software runs.因此,建议更改运行语音识别软件的端口。 Hope this was helpful.希望这是有帮助的。

:) :)

if you are getting this error如果您收到此错误

.............ERROR! The server quit without updating PID file 

Try this尝试这个

Go to /Applications/XAMPP/xamppfiles/var/mysql/转到 /Applications/XAMPP/xamppfiles/var/mysql/

if there is no file with the name Your_Username.local.pid如果没有名为Your_Username.local.pid 的文件

Your_Username should replace with your Mac Username

Create a file with this name用这个名字创建一个文件

Then try然后试试

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start    

its worked for me它对我有用

It had the same problem, all I did was give read-only permissions for ALL users (system included) and all items included in the following folders:它有同样的问题,我所做的只是为所有用户(包括系统)和以下文件夹中包含的所有项目提供只读权限:

/Applications/XAMPP/xamppfiles/etc
/Applications/XAMPP/xamppfiles/sbin

and relaunch XAMPP control and launch mysql server again or并重新启动 XAMPP 控件并再次启动 mysql 服务器或

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start   

I have same problem and get this error in hostname.err in directory /Applications/XAMPP/xamppfiles/var/mysql我有同样的问题,并在目录 /Applications/XAMPP/xamppfiles/var/mysql 中的 hostname.err 中收到此错误

2016-09-06 15:32:45 140735322399488 [Note] Plugin 'FEEDBACK' is disabled. 2016-09-06 15:32:45 140735322399488 [注意] 插件“反馈”被禁用。 2016-09-06 15:32:45 140735322399488 [Note] Heuristic crash recovery mode 2016-09-06 15:32:45 140735322399488 [Note] Please restart mysqld without --tc-heuristic-recover 2016-09-06 15:32:45 140735322399488 [ERROR] Can't init tc log 2016-09-06 15:32:45 140735322399488 [ERROR] Aborting 2016-09-06 15:32:45 140735322399488 [注意] 启发式崩溃恢复模式 2016-09-06 15:32:45 140735322399488 [注意] 请在不使用 --tc-cover-15906-1006-102000 的情况下重新启动 mysqld 32:45 140735322399488 [错误] 无法初始化 tc 日志 2016-09-06 15:32:45 140735322399488 [错误] 中止

2016-09-06 15:32:48 20004 mysqld_safe mysqld from pid file /Applications/XAMPP/xamppfiles/var/mysql/hostname.pid ended 2016-09-06 15:32:48 20004 来自 pid 文件的 mysqld_safe mysqld /Applications/XAMPP/xamppfiles/var/mysql/hostname.pid 结束

Then I removed tc.log and It works fine after restart mysql through manager-osx然后我删除了 tc.log,它在通过 manager-osx 重启 mysql 后工作正常

This could be due to the fact that another instance of mysqd is already running in your mac-book-pro (MacOs-10).这可能是因为另一个 mysqd 实例已经在您的 mac-book-pro (MacOs-10) 中运行。 It's next to impossible to kill/pkill mysqld or ....I tried that route many times, with out any success.几乎不可能杀死/pkill mysqld 或......我尝试了很多次这条路线,但没有任何成功。 Finally the following worked for me :最后以下对我有用:

launchctl unload -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

wait a few minutes and check with等待几分钟并检查

ps -ef|grep mysqld

It should be gone!应该没了!

on

macOs High Sierra macOS 高山脉

if mysql is not getting started from manager- oxs and have tried direct command ie如果 mysql 不是从 manager-oxs 启动并尝试过直接命令,即

sudo /Applications/XAMPP/bin/mysql.server start

too than go to path edit也不要去路径编辑

/Applications/XAMPP/xamppfiles/etc/ /应用程序/XAMPP/xamppfiles/etc/

find file :查找文件:

my.cnf我的.cnf

edit it编辑它

under the [mysqld] section, add following line:在 [mysqld] 部分下,添加以下行:

innodb_force_recovery = 1

after it save and run or can be done from manager-osx保存并运行后,或者可以从 manager-osx 完成

sudo /Applications/XAMPP/bin/mysql.server start

it should start the mysql.它应该启动mysql。

once its run you need to again edit the一旦运行,您需要再次编辑

my.cnf我的.cnf

file and remove the line just added文件并删除刚刚添加的行

innodb_force_recovery = 1

stop and start mysql again.停止并再次启动mysql。 by command通过命令

sudo /Applications/XAMPP/bin/mysql.server start 

or by manager-osx或者通过 manager-osx

it will be working fine.它会工作正常。

It might be the possibility that your voice recognition software has a installer of mysql internally and when u installed this software, it has installed mysql too and added it to the service and this mysql service starts once your system starts.可能你的语音识别软件内部有一个mysql的安装程序,当你安装这个软件时,它也安装了mysql并将其添加到服务中,一旦你的系统启动,这个mysql服务就会启动。 So now ur having two mysql servers (one from voice recognition software and second is from XAMPP) that's why killing the previous process (mysql service) solved your problem.所以现在你有两个 mysql 服务器(一个来自语音识别软件,第二个来自 XAMPP)这就是为什么杀死前一个进程(mysql 服务)解决了你的问题。 But this is not a permanent solution, you have to repeat it every time when ever you start your machine.但这不是永久的解决方案,每次启动机器时都必须重复它。 So better is to find out that mysql server (service) and change its port no.所以更好的是找出mysql服务器(服务)并更改其端口号。 OR change settings so that mysql service should not start when your machine start (but might be your voice recognition software won't work properly)或更改设置,以便在您的机器启动时不启动 mysql 服务(但可能是您的语音识别软件无法正常工作)

I hope it will help you.我希望它会帮助你。

Cheers干杯

You seem to have found a work-around by killing the process, but make sure you check for free space on your MySQL partition.您似乎通过终止进程找到了解决方法,但请确保检查 MySQL 分区上的可用空间。 If your logs or db files are consuming all your drive space, mysqld will not start.如果您的日志或数据库文件占用了您所有的驱动器空间,mysqld 将不会启动。

Restarting the computer, or using the 'kill' commands listed above solve the problem.重新启动计算机或使用上面列出的“kill”命令可以解决问题。 AS for preventing it from happening, I've found this occurring anytime my computer goes to sleep.为了防止它发生,我发现只要我的计算机进入睡眠状态就会发生这种情况。 The port is obviously kept reserved, and then on wake, mysql tries to reconnect to that port, but can't.该端口显然保留保留,然后在唤醒时,mysql 尝试重新连接到该端口,但不能。 This could be your problem also.这也可能是你的问题。

I am running XAMPP 5.6.3-0 for OS X Yosemite 10.10.2 and ran into the same issue twice, the first time was with Mavericks.我正在为 OS X Yosemite 10.10.2 运行 XAMPP 5.6.3-0 并两次遇到相同的问题,第一次是在小牛队。 With a bunch of different solutions to the issue with MySQL Database not starting using Manager App I wanted to confirm what had worked for me.对于 MySQL 数据库未开始使用 Manager App 的问题,有很多不同的解决方案,我想确认对我有用的方法。 The workaround that always worked and forced MySQL to start was by opening Terminal and using: sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start I had the Manager App open and started ProFTPD and Apache and then ran the sudo command.始终有效并强制 MySQL 启动的解决方法是打开终端并使用: sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start 我打开 Manager App 并启动​​ ProFTPD 和 Apache,然后运行 ​​sudo 命令。

The other suggestion by wishap that worked was to locate /Applications/XAMPP/xamppfiles/etc/my.cnf file and change the permissions for "everyone" to Read only. Wishap 的另一个建议是找到 /Applications/XAMPP/xamppfiles/etc/my.cnf 文件并将“每个人”的权限更改为只读。

The other problem I had that seems to be another issue with many solutions is the problem after everything is started then entering localhost which brings me to the xampp splash screen and then nothing.我遇到的另一个问题似乎是许多解决方案的另一个问题,那就是在一切都开始之后,然后输入 localhost 的问题,这将我带到 xampp 初始屏幕,然后什么也没有。 The only thing that worked for me, to at the very least, to access the phpMyAdmin page is by entering localhost/phpmyadmin唯一对我有用的东西,至少,访问 phpMyAdmin 页面是通过输入 localhost/phpmyadmin

I hope this helps others reading through a bunch of threads for an answer.我希望这可以帮助其他人阅读一堆线程以获得答案。

Regards, Erik问候, 埃里克

试试这个, sudo service mysql stop它将停止任何其他 mysql 服务,然后重新启动 xampp

Just Click on Managed Servers Tab in XAMPP MANAGER , Now select MySQL Database, Click on configure on right side.只需单击 XAMPP MANAGER 中的托管服务器选项卡,现在选择 MySQL 数据库,单击右侧的配置。

Change port from 3306 to 3307 and it will work.将端口从 3306 更改为 3307,它将起作用。

It had the same problem, all I did was give read-only permissions for all users and all items included in the following folders:它有同样的问题,我所做的只是为所有用户和以下文件夹中包含的所有项目提供只读权限:

/Applications/XAMPP/xamppfiles/etc
/Applications/XAMPP/xamppfiles/sbin

Well, sometime there is just ERROR!好吧,有时只是ERROR! message is shown in mysql comment on terminal.消息显示在终端上的 mysql 注释中。 Then, just reinstall (overwrite) XAMPP, then it can be solved.然后,只需重新安装(覆盖)XAMPP,即可解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM