PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, December 28, 2021

[FIXED] MySQL server does not start with MAMP

 December 28, 2021     mamp, mysql     No comments   

Issue

Environment

  • Mac OS Big Sur Ver 11.6
  • MAMP Ver 6.5
  • PHP Ver 7.4.21
  • MySQL Ver 14.14 Distribute 5.7.34

Issue

I was using MySQL on MAMP but now having errors after restarted my mac.

First, I got this error.

$ mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

And, the Stop-icon on MAMP is orange (I think it was usually green).

enter image description here

What I did so far:

  1. Checked if the mysql.sock file exists.
$ ls /Applications/MAMP/tmp/mysql/
  1. Created mysql.sock file.
$ touch /Applications/MAMP/tmp/mysql/mysql.sock
  1. Tried to start mysql again. (The Error message changed from (2) to (38).)
$ mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (38)
  1. Tried to start mysql server.
$ mysql.server start
-bash: mysql.server: command not found
  1. Checked if the path is set.
$ mysql --version
mysql  Ver 14.14 Distrib 5.7.34, for osx10.12 (x86_64) using  EditLine wrapper
  1. Used the full path
$ /Applications/MAMP/Library/bin/mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

Solution

This issue was resolved by removing (just moved to trash) and reinstalling MAMP.



Answered By - Takichee
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing