Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JakeGWood

macrumors newbie
Original poster
Jul 3, 2011
8
0
I just started learning MySQL and PHP and am using MAMP. My book (O'Reilly, PHP, MySQL and JScript) recommended that I switch the default ports to 80 and 3306 for apache and MySQL. However, when I did that, on the startup menu for MAMP the status box gives the green light for the Apache server, but red light for the MySQL. I tried switching back to 8888 and 8889, MAMP's defaults, but no luck, and I did have two green lights before.

Any ideas? Thanks
 
I just downloaded XAMPP and it also can't access the MySQL server. It says XAMPP MySQL can't run while another MySQL is running. Even if I quit MAMP, whose MySQL isn't working anyway, it still gives me the same error.
 
Sounds like the MySQL process is stuck. Logging out and back in may help or rebooting.
 
Yeah, that worked, but it seems like every time I quit MAMP and then open it back up, the MySQL won't start back up and have I have to log out/in again in order for it to do say, so it's habitual problem. Any ideas where it may lie?
 
I recommend looking at the MySQL log (/Applications/MAMP/logs/) and the Console app (/Applications/Utilities/Console), especially when quitting.
 
With respect to port 80, are you sure you are not conflicting with another process (built-in Apache) running on that port?
Is Web Sharing turned on under Settings|Sharing?

Even though 80 and 3306 are the Apache/Mysql default ports, I've found that it's easier to just to use the MAMP port defaults instead because it eliminates conflicts and it doesn't require entering your administrator password every time you start up.

In fact, I avoid the MAMP GUI altogether and create symbolic links to all the start/stop shell scripts from the MAMP folder to my home folder and just control things via the terminal.

The only time using the MAMP default ports is an issue is when you hard code the port number into your application code and move environments. This can be addressed easily with some simple if/else logic.
 
With respect to port 80, are you sure you are not conflicting with another process (built-in Apache) running on that port?

Where would I find this info?

Even though 80 and 3306 are the Apache/Mysql default ports, I've found that it's easier to just to use the MAMP port defaults instead because it eliminates conflicts and it doesn't require entering your administrator password every time you start up.

Any good tutorials for this? Overall, I need a way better understanding of the terminal and UNIX. Any good and thorough tutorials for not only terminal use but what it means in terms of the system itself? A lot of the ones a find are for pretty basic file management tasks, or just overall not that insightful.
 
Funny I just got done recommending MAMP in another thread saying how reliable it is, etc. ;)

There have been a few times however when the MySQL locks up. 99% of the time you can just restart your computer.

Or if you want to get fancy pants:

Open the terminal.

Use
Code:
killall -9 mysqld

If that doesn't work you're probably boned ... delete and reinstall MAMP. You should always be backing up your SQL database FYI...
 
I have been using MAMP for years and have several tutorials under my former handle and think you need to understand how MAMP works so i will explain.

MAMP's configuration is unique and I would not recommend changing any off the settings at all. OS X comes with apache pre-installed and MAMP sets up another apache server but in a separate location that becomes the default for MAMP.

Where it can get tricky is defining the site, this is where most people go wrong. I did a video tutorial on MAMP installation and defining the site properly at this http://www.dreamweaverclub.com/vtm/mamp.php

Please view the VTM and you will learn how this will work for you. I would recommend installing MAMP completely and follow the VTM.

Hope this helps.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.