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 trialGreg Wilson
Front End Web Development Techdegree Student 3,526 PointsMAMP 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
2,199 PointsCannot see localwp.dev when I click on MAMp MyWebsite. It redirects me to the page MAMPPRO
9 Answers
Eric Butler
33,512 PointsHey Greg, Not sure it'll help because this sounds like a unique configuration problem, but here are some things I would try:
- Go to MAMP's Preferences (with the app open, it's under "MAMP" in the top bar).
- 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.
- Make sure you're not trying to connect to a Cloud account.
- 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.
- 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
Front End Web Development Techdegree Student 3,526 PointsThanks 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 Wilson
Front End Web Development Techdegree Student 3,526 PointsHmm... the stuff at the last link didn't make sense to me...
Greg Wilson
Front End Web Development Techdegree Student 3,526 PointsGot it workin!! Woohoo!!! Just had to turn MySQL server on!!
Greg Wilson
Front End Web Development Techdegree Student 3,526 PointsOy, now I can't figure out how to turn MySQL server on again.... I don't know how I did it before... So not working..
Eric Butler
33,512 PointsGreg, 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.
Greg Wilson
Front End Web Development Techdegree Student 3,526 PointsThank you Eric. I tried that but it only turns on the apache server, not the MySQL one.... : (
Eric Butler
33,512 PointsTry 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.
Greg Wilson
Front End Web Development Techdegree Student 3,526 Pointshmm.. still not working. I tried reinstalling too...
Arron Mottley
2,394 PointsHello 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
25,709 PointsTried 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.
Rob Pala
2,199 PointsRob Pala
2,199 PointsCannot see localwp.dev when I click on MAMp MyWebsite. It redirects me to the page MAMPPRO