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!
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
MySQL Server light is not lit up (it's not on)
Hi. Does this mean I have to install MySQL Server?
There are many posts with the same common error I have:
Access denied! 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.
There's a lot of advice I've already done:
Restart Serversin MAMP
set Web and MySQL ports to 80 and 3306
spend hours on Stack Overflow and reading the other posted messages.
Please feel free to suggest anything, there's no harm in suggesting a solution, even if I've already tried it. Thanks.
Danny Boisvert4,576 Points
I encountered the same problem as you with MAMP's MySQL Server. I think the source of the problem comes from setting the MySQL port to 3306. I went through the same Stack Overflow solutions that you indicate but none of them fixed the issue. I then decided to reinstall MAMP and reset the ports to default before launching the server for the first time (after reinstalling) and it worked. Unfortunately, this means that the option to run WordPress locally using the folder's name as a URL won't work :(
Wish you the best of luck finding a solution to this problem! If you do, it would be greatly appreciated if you could share your findings :)
Thank you so much! I will try it. I've posted dozens of questions in Treehouse that were fixed quickly by user responses... this has been one of those really tangled complex problems... but reinstalling MAMP is something I have yet to do. Thanks!
I also had this problem when setting up MySQL with MAMP. What ended up working for me was uninstalling MAMP 4.1.0 and then installing an older version (3.3.1) of MAMP.
Credit to Alaxander on stackoverflow: MySQL not starting on MAMP. Nothing is working
DeChaune Myers2,686 Points
Something of note if you're still having this problem, try going to your C drive>MAMP>db>mysql and delete the index file before starting your servers.
It worked for me but admittedly I don't know if there are any long term implications for it.
Credit to YouTube, Rigo De La Torre for the help.
( I don't know how to link to websites here just yet)
Dan Bearden24,231 Points
I too experienced this issue. To resolve it on my machine, I completely uninstalled "MAMP & MAMP PRO", then reinstalled from the "MAMP & MAMP PRO" installer, but this time I unchecked the "Install MAMP PRO" option so that only MAMP was installed on the machine. I think when the installer installs both executables there is some kind of issue on the configs.