Mysql server on MAMP won't start

 ̄綄美尐妖づ 提交于 2019-12-17 17:34:35

问题


My Mysql server on MAMP won't start. This is the error:

161224 00:15:00 mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error_log.err'. 161224 00:15:00 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql56 161224 00:15:01 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended

I already tried the following commands:

> ps aux | grep mysql
> lsof -i
> sudo killall -9 mysqld

But the server is still not working.

Help ?


回答1:


Remove the files ib_logfileN (N being the number) from the MAMP/db/mysql56 folder.

Then restart MAMP.

Should Work!!

Edit: If the above step doesn't work completely, please remove the ibdata<n> file as well, based on the comments.




回答2:


I am working on oS-X (Mac), I was wondering around and came to see this post which help me a lot.
Many readers are being able to solve this problem thanks to the amazing here are the step to fix it out--

This issue generally occur due to explicitly closing of MAMP serves.

  1. Quit MAMP.
  2. In the finder go to Applications/MAMP/db/mysql/
  3. Delete the last log file (look for a file named ib_logfileN – being N the log number Eg-ib_logfile0 and ib_logfile1) we can see in below image.

  1. Please back up these before you delete them.
  2. Restart MAMP.

It Worked for me, hope will work for you too..




回答3:


I killed the process mysqlid via Activity Monitor on MacOS and restarted MAMP and MySql run successfully.

Update: Even this solution works without restarting MAMP.




回答4:


My MAMPs MySQL stopped working after a power failure, this worked for me:

  1. Stop servers from terminal

    • cd /Applications/MAMP/bin
    • ./stop.sh
  2. Create my.cnf file in /Applications/MAMP/conf with the following: [mysqld] innodb_force_recovery = 1

  3. Start MySQL from same terminal window.

    • ./startMysql.sh
  4. Stop MySQL once it has recovered (Check the log in /Applications/MAMP/logs/mysql_error_log.err).

    • ./stopMysql.sh
  5. Remove the lines from my.cnf, save and start the servers as usual from the MAMP app.




回答5:


In some cases it may possible that the MySQL is already running on 3306 port. So, you can change the port number with 3307.

P.S: If you are bound to use 3306 in that case I think you can stop existing MySql server and let MAMP to do it for you.




回答6:


MAMP is so touchy. Here's what worked for me:

cd /Applications/MAMP

Move or rename: mv tmp tmp_OLD.

Recreate the folder and a subfolder: mkdir tmp; mkdir tmp/mysql

Now start mysql from MAMP. I think it's possible the socket lock file (tmp/mysql/mysql.sock.lock) gets corrupted and needs to be regenerated.



来源:https://stackoverflow.com/questions/41309275/mysql-server-on-mamp-wont-start

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!