简体   繁体   English

mysql服务器无法启动MAMP

[英]mysql server won't start MAMP

I've read a few answers on here that say when your mysql server won't start in MAMP you should run 我在这里读了一些答案,说当您的mysql服务器无法在MAMP中启动时,您应该运行

sudo killall -9 mysqld 

I've used that in the past and it has worked but for whatever reason it is not working this time. 我过去曾经使用过它,但它一直有效,但是由于某种原因,这次它不起作用。 I'm getting this error message in the logs: 我在日志中收到此错误消息:

[04-May-2014 11:02:08 UTC] PHP Warning:  mysql_connect(): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2) in /Users/Chappell/Websites/LFB/wp-includes/wp-db.php on line 1372

I recently transferred the files (not MAMP itself) for the site I'm working on from another computer where I was developing locally. 我最近从另一台本地开发的计算机上传输了我正在工作的站点的文件(而不是MAMP本身)。 Not sure if that's relevant but thought I'd point it out. 不知道这是否相关,但以为我会指出。

I first tried 'sudo killall -9 mysqld' and didn't find any processes. 我首先尝试了“ sudo killall -9 mysqld”,但是没有找到任何进程。

What did work for me was removing all files (but not directories) in the mysql dir: rm /Applications/MAMP/db/mysql/* 对我有用的是删除mysql目录中的所有文件(但不是目录):rm / Applications / MAMP / db / mysql / *

Deleting the log files within the MAMP directory fixed this for me. 删除MAMP目录中的日志文件为我解决了这个问题。 Quit MAMP and try this in the terminal. 退出MAMP并在终端中尝试此操作。

rm /Applications/MAMP/db/mysql56/ib_logfile0

rm /Applications/MAMP/db/mysql56/ib_logfile1

Open MAMP back up and try starting the servers again. 备份打开MAMP,然后尝试重新启动服务器。

The problem was quite simple in the end. 最后,问题很简单。 I was using different versions of MAMP on the two separate computers. 我在两台不同的计算机上使用了不同版本的MAMP。 I just installed the latest version and it's working like a charm. 我刚刚安装了最新版本,它的运行就像一个魅力。

It's been a while since this question but here's what worked for me: 这个问题已经过去了一段时间,但这对我有用:

I had mysql workbench boothing at computer restart. 在计算机重新启动时,我有mysql workbench摊位。 Deleted the software and everything was working. 删除了软件,一切正常。

None of the solutions fixed my issue. 没有一种解决方案可以解决我的问题。

What I did was backup databases from /Library/Application Support/appsolute/MAMP PRO/db , and also backup "MAMP" folder. 我所做的是从/Library/Application Support/appsolute/MAMP PRO/db备份/Library/Application Support/appsolute/MAMP PRO/db ,并且还备份了“ MAMP”文件夹。

Then deleted all and reinstalled Mamp. 然后删除所有并重新安装Mamp。

Apparently my databases in /Library/Application Support/appsolute/MAMP PRO/db were damaged because when I copied the old ones there , the same issue started to happen. 显然, /Library/Application Support/appsolute/MAMP PRO/db已损坏,因为当我在其中复制旧/Library/Application Support/appsolute/MAMP PRO/db时,同样的问题开始发生。

I ended up copying (inside /Library/Application Support/appsolute/MAMP PRO/db/mysql56 ) only the important database folder, and ibdata1 file. 我最终只复制了重要数据库文件夹和ibdata1文件(在/Library/Application Support/appsolute/MAMP PRO/db/mysql56 )。 Now everything works fine. 现在一切正常。

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

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