Problems with MAMP - Unable to connect to MySQL server


#1

Hello, I’m currently finishing lc101 at my own pace and have gotten up through 2.9. My issue is happening with MAMP and the MySQL server.

When I first installed MAMP, it was working properly and I was able to add new databases on phpMyAdmin and fully complete part one of the get-it-done app.

When I came back to work on the project further, I was unable to access phpMyAdmin. The error I receive is:

MySQL said: Documentation

Cannot connect: invalid settings.
mysqli_real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

I uninstalled and reinstalled MAMP, and again it worked perfectly on its initial launch. However, after I finished my programming session, I closed it and upon trying to reopen it am having the same problem.

Here are my troubleshooting steps, cautiously following internet comments:
checked to make sure ports were correct (3306 for MySQL)
checked the php config file - user and password were both configured correctly to “root”. I also tried hardcoding host as both “localhost” and “127.0.0.1”.
changed the auth in the php config file from “config” to “cookie” - brought up a different login screen, but still no luck accessing the server (I changed back after this experiment)

Feeling frustrated, and also worried that I might erase data if I continually unintsall and reinstall MAMP every time I use it. Any suggestions? Is there any way I can just start MySQL from the command line and interface with it differently?


#2

I know it’s a late reply, but it may help others. It sounds like your MySQL server fails to re-start after it is stopped. Or, perhaps, a firewall/antivirus software is blocking it. Perhaps these resources will be helpful:


#3

Just an additional thought-- I remember there was some navigation necessary to connect to and go to the server in that application. It may be that the presets when you re-install take you right there, but after that you have to do it manually. To check that, you could watch someone else logging in to their application (maybe at class?)