Todays Date Script

Hey guys,

I am a new user (taking a Web Dev class) and I installed PHP, MySQL and MAMP on my Mac OS X (v. 10.6.7). I was following along in the book and I have ran into 2 issues.

  1. When I start MAMP it fails to load the initial page (says there is a password conflict), the book told me change the default password from root; which I did.

  2. When I run a script to find today’s date (per my local server)
    [I]Today’s date (according to this web server) is
    <?php

     	echo date( '1, F dS Y.' ); 
     	
     	?&gt;[/I]
    

instead of telling me that it is monday or friday, it returns 1… ie “Today’s date is 1, April 12, 2011”

can anyone help me with this issue.
Thx!

Should be the letter L ( l ) in lower case, not 1.


echo date( 'l, F dS Y.' ); 

Try changing the default password back to root, so user: root password: root host: localhost

See if that works. If it doesn’t, then there is a separate issue which we can look into

Ok… changing the “1” to a “l” worked… Thx. Is there no way to tell the MAMP program that that password is “xxx” and not root? I only changed the password b/c the book suggested it.

Oh okay, so what you need to do is change the password for phpMyAdmin in the file /Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php" , where X.X.X is the version numbers. Just always make sure the password for MAMP and phpMyAdmin are the same.

Ok I went to the folder /Applications/MAMP/bin/phpMyAdmin (it said there was no such folder/file containing the -1.9.5/config.inc.php) and changed the password from root to my new password. When I start up MAMP this is the error that I get and have been getting.:
/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access denied for user ‘root’@‘localhost’ (using password: YES) when trying to connect

Do I need to search out this folder and do the same thing there also… or change the other back to root and then change this one?

Ok. it will not let me open the said file, when i search for it… it looks like a exec file that wants to open via Terminal Window. Now there is a mysqlaccess.conf file that has password settings…

Try changing the password in /Applications/MAMP/bin/mamp/index.php to your new password. Or have you done this already?

should be a line looking like this


$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root'); 

Ok, i changed the 2nd ‘root’ to a my new password and it will now load the initial MAMP page when I start the program, yet I am still getting this error:
/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access denied for user ‘root’@‘localhost’ (using password: YES) when trying to connect

Side note: I did not start getting that error until the i changed the password initially, it should also be noted that I only opened MAMP twice before I changed the password.

How’d you go about changing the password initially? Through the terminal?

Yea, im not sure of the exact way… leme look it up…

mysqladmin -u root -p password xxxxxx

another thing I am not sure about… is this line:

sudo /usr/sbin/apachect1 restart

when I type that into the Term, it tells me that it is a Unknown Command.

That last one should be a " l " (lower case L), not a 1 (one) :


/usr/sbin/apachect[color="red"]l[/color]

Strange how using the proper character makes all the difference… Thx!

You know I went back and looked, and its is the font that they choose for the book… all of the “l” look like “1”