image
image

|


Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #1  
Old June 20th, 2008, 01:52 PM
Registered User
 
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
307kertess is on a distinguished road
no localhost in MAMP

I installed MAMP on my laptop yesterday and had relatively little difficulty getting it up and running. Today, I've moved the laptop out of range of the wireless network, so it has no internet connection. But I thought I should still be able to write PHP webpages that point to the mySQL database on my laptop. Although myPHPAdmin is working just fine, and I can easily manipulate the data there, Firefox seems unable to do anything that requires a connection to "localhost." Any ideas on how I should be pointing the mysql_connect command? I've tried localhost:8889, which is the specific port where mySQL is supposed to be, and I've tried simply putting in the file path to where the database is stored, but neither worked.

Thanks in advance.
Reply With Quote
  #2  
Old July 3rd, 2008, 11:34 AM
Registered User
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
zotrik is on a distinguished road
Try this:

Click on the server tab in Mamp.
click on the select MySQL root password. create one; for the example I'll call it "password",

then, your php code must start like this:
<?php
mysql_connect("localhost", "root", "password");
mysql_select_db("your_database");
/*
php code....
*/
?>

Mamp doesn't support a root without password.
Reply With Quote
Reply

Tags
localhost, mamp

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 05:00 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.