MAMP, Netbeans, MySQL workbench help

Discussion in 'MacBook Pro' started by Justkeepmoving, Jan 31, 2012.

  1. Justkeepmoving macrumors newbie

    Joined:
    Jan 21, 2012
    #1
    Hi all,

    Very new to using MAMP and not too hot with running diagnostics or using terminal (though i know some basics).

    My problem is i think in setting up MAMP, MySQL workbench and Netbeans to work together... the actual issue is when i click on 'run project' in Netbeans, it opens safari and says that it can't connect to localhost:8888. i am trying to run an .html page.

    I ran 'sudo apachectl -t' through terminal as mentioned in another forum and it said 'syntax ok'. Not sure how relevant this is.

    Using Mac OS X 10.6.8. I had some issues setting up a new server instance in MySQL workbench- I'm still not sure that my settings are right though the paths check out:

    path URL/admin tool: /Applications/MySQLWorkbench.app
    Path to start command: /Applications/MAMP/bin/startMysql.sh
    Path to stop command: /Applications/MAMP/bin/stopMysql.sh

    Oh, also thought it was weird that my basic MySQL server properties (netbeans>services>databases>properties) defines the port i'm using as 3306. Though my MAMP port as defined on the starter page that opens in my browser on opening MAMP is 8889. And Safari is telling me it cant connect to localhost:8888. Why are all these different and should they be the same? The new server instance that i created in MySQL workbench was created on 3306.

    Well, thats all the info i can think to provide. Any advice appreciated or links to a good MAMP configuration tutorial perhaps (I have been following a WAMP config tutorial, but it is different. Some of the paths and file names are different to mine and even some of the steps are different. Can't find anything online that explains what i need to know)

    Thank you, really appreciate any responses to be able to finally preview my site!
     
  2. D.T. macrumors 603

    D.T.

    Joined:
    Sep 15, 2011
    Location:
    Vilano Beach, FL
    #2
    Howdy!

    I'm not doing any development using MAMP (i.e., this post will be of no help :D ), but I can tell you that the different services will run on different ports, including any web UI front end to the DB, web configuration, etc.

    i.e., I'm running Oracle (the listener) on one port, the web UI for Oracle on another port, the actual web site on a 3rd port (on the same IP, machine) ... it's a very typical setup.

    Does your MAMP (assuming this is a server config/properties web UI) fire on localhost:8889 ?
     
  3. Justkeepmoving thread starter macrumors newbie

    Joined:
    Jan 21, 2012
    #3
    Howdy!

    Thanks for your reply, thats reassuring, though any idea how to check that they are actually correct?

    Yes,I believe MAMP fires on 8889... if this means when i open MAMP and it automatically opens a test page in Safari, it tells me:

    Host localhost
    Port 8889
    User root
    Password ____

    Also, MAMP's statuses are both green/ running, i.e. apache server and MySQL server.
     
  4. D.T. macrumors 603

    D.T.

    Joined:
    Sep 15, 2011
    Location:
    Vilano Beach, FL
    #4
    I'm sure someone with some actual experience will pop in, but in the interim, I might install it myself! I kind of like fiddling around with this sort of thing ... I"m currently doing all my dev work in a Win7 VM (via Parallels), but it's sometimes a nice break to knock around in another language/framework/OS.
     
  5. Schlaefer, Jan 31, 2012
    Last edited: Jan 31, 2012

    Schlaefer macrumors member

    Joined:
    May 11, 2010
    #5
    Apache - the webserver - you can connect to in the browser runs on 8888 default http://localhost:8888/. MySQL localhost default port is 8889.

    You shouldn't have to touch the Terminal at all, just start the MAMP.app and hit Start Servers. If both lights are green, all should be fine. If you saw the test page, it is running.

    Netbeans, what did you do exactly? What do you expect, what actually happens?

    Workbench:

    [​IMG]

    Enter password `root` when asked. You should now be connected.
     
  6. D.T. macrumors 603

    D.T.

    Joined:
    Sep 15, 2011
    Location:
    Vilano Beach, FL
    #6
    Yeah, I downloaded MAMP, installed the package (took ~45 seconds!)

    I've got Apache running on port 8888, and mySQL running on 8889.

    I dropped an index.htm into /Applications/MAMP/htdocs and it showed up like expected. There's a web UI at localhost/MAMP (I guess it's a built in app alias/mapping).

    I see you can switch to the default ports where Apache runs on 80 and mySQL is on 3306.

    I think with Netbeans, it's just assuming the standard 3306 port (lots of DB connectivity libs work on a default port).

    Downloaded mySQL Workbench, installed, connected right over to the mySQL DB running as part of MAMP, used the port indicated in the prefs window (8889). Created a schema and a couple of tables.

    Everything looks like it's running pretty solid[?]

    Pretty nice packge too, I did a little work on a friends site several months ago, PHP and mySQL, and this would have been nice (though professionally, I'm normally in .NET and MS SQL or Oracle).
     
  7. Justkeepmoving thread starter macrumors newbie

    Joined:
    Jan 21, 2012
  8. Justkeepmoving thread starter macrumors newbie

    Joined:
    Jan 21, 2012
    #8
    Ok, well I think thats part of the problem- each seems to test ok, but i still can't run my site...

    MAMP- Both lights are green and it takes me to the test page saying MAMP is working correctly. My Apache port under MAMP preferences is set to 80 and the MySQL port is set to 3306.

    MySQL Workbench- I've taken a screenshot of the home screen, this is what i have done so far. As you can see in the second screen shot, the port is set to 3306, not 8889 like in your screen shot, shclaefer. I changed it to 8889 and clicked test connection, but this didnt work, so changed it back to 3306 and this tested ok.

    Netbeans- Basically i started writing a site in .HTML in notepad which previews fine if i simply open it with safari. I have just copied this one html page to netbeans with one .CSS page (and changed all paths accordingly, linked correctly etc) and i am trying to preview it through the 'run' project' feature in netbeans. When i click this, safari comes up with a grey page saying can't connect to localhost:8888.

    I've also taken a screen shot of the start/stop MySQL command paths which im not sure about. The sudo file at the bottom has a path starting with usr/bin which im not sure about either!

    Thank you for your effort by the way, trying to be as specific as i can!

    http://forums.macrumors.com/attachment.php?attachmentid=322499&stc=1&d=1328069816

    http://forums.macrumors.com/attachment.php?attachmentid=322498&stc=1&d=1328069816

    http://forums.macrumors.com/attachment.php?attachmentid=322500&stc=1&d=1328069816
     

    Attached Files:

  9. Schlaefer macrumors member

    Joined:
    May 11, 2010
    #9
    If you changed it in mamp to 3306 it isn't 8889 anymore. So that's fine.

    Netbeans: did you create a project? Right click on it -> Properties -> Run Configuration -> Project URL check that there's no 8888 in the path anymore (if you changed it in MAMP from 8888 to 80). It should just read "http://localhost/" (or "http://localhost:80/") but not "http://localhost:8888/".
     
  10. Justkeepmoving, Feb 1, 2012
    Last edited: Feb 1, 2012

    Justkeepmoving thread starter macrumors newbie

    Joined:
    Jan 21, 2012
    #10

    Attached Files:

  11. Schlaefer macrumors member

    Joined:
    May 11, 2010
    #11
    You have to call your page "index.html" and apache will deliver it automatically.

    If it doesn't find a index.html (or index.php if you do PHP) in a directory mamp is configured so that it shows you the directory content.
     
  12. Justkeepmoving thread starter macrumors newbie

    Joined:
    Jan 21, 2012
    #12
    Awesome, I've done that now and it works. So my home page needs to be named index.html then.

    Thank you so much for your help, no idea how long i've been scratching my head over this one! Always the little things!
     

Share This Page