SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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)
    Today’s date (according to this web server) is
    <?php

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

    ?>

    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!

  2. #2
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should be the letter L ( l ) in lower case, not 1.

    Code:
    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

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by svcghost View Post
    Should be the letter L ( l ) in lower case, not 1.

    Code:
    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.

  4. #4
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tappiocca View Post
    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.

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by svcghost View Post
    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..

  6. #6
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Code:
    $link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root');

  7. #7
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by svcghost View Post
    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
    Code:
    $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.

  8. #8
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How'd you go about changing the password initially? Through the terminal?

  9. #9
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by svcghost View Post
    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.

  10. #10
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    That last one should be a " l " (lower case L), not a 1 (one) :

    Code:
    /usr/sbin/apachectl
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  11. #11
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    That last one should be a " l " (lower case L), not a 1 (one) :

    Code:
    /usr/sbin/apachectl
    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"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •