简体   繁体   中英

Mysql server on MAMP won't start

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 ?

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.

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..

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 .

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.

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 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.

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

PS: 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.

I tried everything but I don't know why I didn't find this solution yet.

  1. Quit Mamp
  2. Go To /Application/Mamp/tmp/mysql
  3. Delete File mysql.sock.lock
  4. Start Mamp Server and that's all

+1 if this answer is helpful :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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