0

I'm having some issues with my local environment. I had setup a wordpress site locally on my Mac through MAMP. All was working well until my computer powered down (not plugged into power source). Now there appears to be issues with the database. When i run MAMP and try to connect I get the error "Error establishing Database Connection". Also when i go through the MAMP portal at localhost and click on Tools > PHPMyAdmin I get the following error:

MySQL said: Documentation

#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).

mysqli_real_connect(): (HY000/2002): No such file or directory

Obviously something has gone very wrong with the database connection but do not know how to resolve. I have tried to run some scripts in terminal to stop mysql process to no avail so far.

Any advise appreciated. I have looked at some similar but not exact other posts and does not seem to resolve.

Note: The ports changed at some point in the process, but everything else seems fine related to the new port setup but this may be relevant

thanks

Henesnarfel
  • 2,129
  • 1
  • 16
  • 18
  • which mamp version you are running? did you try `localhost/phpmyadmin` in browser? – Atlas_Gondal Dec 07 '17 at 16:26
  • I had recently updated to a new version 4.2.1. Localhost/phpadmin brings up the same error – MNelson11 Dec 07 '17 at 16:42
  • error msg just to clarify Error MySQL said: Documentation #2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured). mysqli_real_connect(): (HY000/2002): No such file or directory – MNelson11 Dec 07 '17 at 16:42
  • restart mac and start mamp before running any app, if it didn't work then click on `set server ports to 80.....` from mamp settings page and then try again – Atlas_Gondal Dec 07 '17 at 16:58
  • thanks. restarted mac and followed your direction. Still got the same error message. my ports are current set as apache: 80 nginx:80 mysql: 3306 should i still set server ports to 80 or am i good there – MNelson11 Dec 07 '17 at 17:25
  • Could be similar to this: https://stackoverflow.com/questions/16021564/mamp-mysql-server-wont-start-no-mysql-processes-are-running/28655020 – vlasits Dec 07 '17 at 17:59
  • did you follow those instructions? – Atlas_Gondal Dec 08 '17 at 06:24
  • Yes I had tried these two methods previously. When I delete the log files in the db and restart same error. I have also tried the killall -9 mysqld in terminal. This also doesn't seem to work. Although there appears to be some sort of issue with the command for me "No matching processes belonging to your file were found" – MNelson11 Dec 09 '17 at 04:01

2 Answers2

0

While, I'm not sure of the cause. FINALLY found a solution to this very frustrating issue.

What ended up working for me is to uninstall the new version 4.2.1

I did this through first going to the MAMP PRO folder and using the MAMP Pro uninstaller and then moving the Mamp and Mamp pro folder to the trash.

I then went and found the old version to install https://www.mamp.info/en/downloads/older-versions/

When I downloaded 3.5.2 whatever issues it was having with local databases were resolved. Go figure! Glad to finally have resolved not sure why this would happen other than perhaps a bug in the new version.

Thanks to those who pointed out some possible things to look at

  • I'm running MAMP 4.0.6 and getting the same error on local wordpress installations, and same error message as described when trying to go to phpmyadmin on MAMP. I'd however like to solve this without uninstalling, removing all data from databases and htdocs while doing so. As i cant access phpmyadmin i can't backup databases there. Other suggestions on how to solve this issue or revert to 3.5.2 and keeping all databases intact? – JJxyz May 17 '18 at 05:09
0

I'm running MAMP 4.0.6 and getting the same error on local wordpress installations, and same error message as described when trying to go to phpmyadmin on MAMP.

The reason seemed to be that the mysql server does not start. The solution that worked for me is offered in this reply in another thread:

https://stackoverflow.com/a/45582509/4623519

Quit MAMP. In the finder go to Applications/MAMP/db/mysql/. Delete the last log file (look for a file named ib_logfileN – being N the log number Eg-ib_logfile0 and ib_logfile1) Nice screenshot provided in link above.

This seems to be happening often according to this post from 2013.

JJxyz
  • 160
  • 11