Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Installing WordPress Locally Installing WordPress Locally Setting up the Environment

Greg Wilson
seal-mask
.a{fill-rule:evenodd;}techdegree
Greg Wilson
Front End Web Development Techdegree Student 3,526 Points

MAMP not working

So under WebStart page for MAMP, under phpMyAdmin, I cannot connect. It says the following:

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.

Do I have to like sign up and create an account first? Thanks,

Greg

Rob Pala
Rob Pala
2,199 Points

Cannot see localwp.dev when I click on MAMp MyWebsite. It redirects me to the page MAMPPRO

Rob Pala
Rob Pala
2,199 Points

Cannot see localwp.dev when I click on MAMp MyWebsite. It redirects me to the page MAMPPRO

9 Answers

Hey Greg, Not sure it'll help because this sounds like a unique configuration problem, but here are some things I would try:

  1. Go to MAMP's Preferences (with the app open, it's under "MAMP" in the top bar).
  2. Under the "Ports" tab, click the "Set Web & MySQL ports to 80 & 3306" button. Click OK. Click Open WebStart page and see if PHPMyAdmin opens when you click on it.
  3. Make sure you're not trying to connect to a Cloud account.
  4. Make sure your username and password are set correctly (they shouldn't be wrong to start, but who knows). Normally the username is "root" and the password is "root". They are set in this configuration file: /Applications/MAMP/bin/phpMyAdmin/config.inc.php, and they should match what your MySQL server's user and password values are (you can check those on the WebStart page at http://localhost/MAMP/ in the center column, halfway down.
  5. Maybe see if any of these options are useful: https://stackoverflow.com/questions/22736396/mysql-no-connection-could-be-made-because-the-target-machine-actively-refused-it

Again, not sure if any of those are helpful, but maybe something'll sort out. Good luck!

Greg Wilson
seal-mask
.a{fill-rule:evenodd;}techdegree
Greg Wilson
Front End Web Development Techdegree Student 3,526 Points

Thanks so much! I tried clicking the "set.." button, but no change... Don't think I'm doing anything with cloud stuff... Where do I put my username and password in?? I'll check out the other options in the link... Thanks,

-Greg

Greg, You should be able to turn on the MySQL Server by clicking the "Start Servers" icon in the MAMP dialog window, or by going to Servers > Start in the top menu. (If the icon or menu say "Stop Servers" instead, click "Stop," wait a few seconds for the servers to stop, then click "Start" again.

Try this: https://stackoverflow.com/a/42082576 If this continues to be a problem, and you haven't done any custom configuration in your MAMP environment that you couldn't easily reproduce, I might suggest you simply re-download and reinstall MAMP fresh. The reinstall should persist anything in your htdocs folder and even keeps your databases if you had any (double-check that so I don't steer you wrong if it matters). This just seems like it's gotten buggy enough that a fresh start might be easiest. MAMP is usually really smooth and "just works" out of the box.

Arron Mottley
Arron Mottley
2,394 Points

Hello Greg

Not sure if you are still having this issue, however i had the same trouble and followed all the steps you have to try to resolve this and it still did not work after reinstall.

However if you open MAMP > go to preferences >Web Server and select Nginx > then open Ports tab and set them to Web & MySQL 80 & 3306.

Save and start your server this fixed it for me.

Chai Chong Teh
Chai Chong Teh
25,709 Points

Tried to reset ports to default and to mamp's recommended config, doesn't help at all. Even after simple reinstall, nothing works. Need to 'clean' delete and then reinstall, which means database wiped. Worst part is, there is no way to get in and backup the database beforehand.