2

I've read a few answers on here that say when your mysql server won't start in MAMP you should run

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. Not sure if that's relevant but thought I'd point it out.

chap
  • 1,860
  • 5
  • 24
  • 39

5 Answers5

12

I first tried 'sudo killall -9 mysqld' and didn't find any processes.

What did work for me was removing all files (but not directories) in the mysql dir: rm /Applications/MAMP/db/mysql/*

Eric Grotke
  • 4,651
  • 3
  • 21
  • 19
3

Deleting the log files within the MAMP directory fixed this for me. Quit MAMP and try this in the terminal.

rm /Applications/MAMP/db/mysql56/ib_logfile0

rm /Applications/MAMP/db/mysql56/ib_logfile1

Open MAMP back up and try starting the servers again.

Fahad Ashraf
  • 1,138
  • 1
  • 6
  • 6
1

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.

Then deleted all and reinstalled 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.

I ended up copying (inside /Library/Application Support/appsolute/MAMP PRO/db/mysql56) only the important database folder, and ibdata1 file. Now everything works fine.

pacholik
  • 8,607
  • 9
  • 43
  • 55
Bify
  • 11
  • 1
0

The problem was quite simple in the end. I was using different versions of MAMP on the two separate computers. I just installed the latest version and it's working like a charm.

chap
  • 1,860
  • 5
  • 24
  • 39
0

It's been a while since this question but here's what worked for me:

I had mysql workbench boothing at computer restart. Deleted the software and everything was working.