Grow your CSS skills. Land your dream job.

Jqueru course and setting up local server (WAMP)

  • # March 2, 2012 at 11:11 am

    I’m currently doing a Learn Jquery in 30 days course and have hit a snag. Lesson 25 uses a local server (WAMP/MAMP) to run some dynamic code but after set up I am getting an error message and I am not sure why. I have used this process before to successfully create mock WP sites using Dreamweaver and used the following steps which should apply again, I think:

    1 – Start MAMP. You should see the start up page. Leave it open.
    2 – Create a site root folder for your site in applications/MAMP/htdocs/.
    3 – Define a new site in dreamweaver.
    4 – In “local info” point everything to the folder you created in the htdocs folder. The http address should be this.

    http://localhost:8888/your-site-folder/

    5 – in “remote info” choose Local/Network from the access menu. Point the remote folded to the folder you created in the htdocs folder.
    6 – in “testing server” choose PHP/mySQL under server model, Local/Network from the access menu and testing server to he folder you created in the htdocs folder. The URL prefix should look like this.

    http://localhost:8888/your-site-folder/

    7 – Hit OK then Done.

    I want to set this up locally so please don’t tell me to run it on a live server. I also know most you aren’t DW fans but I am where I am, and would appreciate your help. I can’t go any further on the course until I complete this tutorial.

    # March 2, 2012 at 11:18 am

    hey there, looks like you just have an issue with your username and password for MySQL
    Off the top of my head the default password for root is blank
    You could open PHPMyAdmin to change this
    most likely at http://localhost/phpmyadmin

    # March 2, 2012 at 11:29 am

    Hi Karl, thanks for replying. I just checked and the password for the db I created is root, which corresponds to the code in the functions.php page in the exercise files.

    # March 2, 2012 at 11:36 am

    Is this the part of the file you’ve edited?

    $pdo = new PDO("mysql:host=localhost;dbname=sakila", "root", "root");

    I think it’s all case sensitive

    # March 2, 2012 at 11:56 am

    Yes, that is the file. I just checked the privileges for the sakila db in phpMyAdmin and they all seem to set to ‘root’, which is the default I think. It is all in lower case as well. Would a screen shot of the phpMyAdmin be any good to you?

    # March 2, 2012 at 11:59 am

    wouldn’t hurt :)

    # March 2, 2012 at 12:05 pm

    Ok, so just to be sure I changed all the passwords for all specified users to ‘root’ and rebooted wamp. No luck.

    Screenshot

    # March 2, 2012 at 12:11 pm

    try this

    $pdo = new PDO("mysql:host=127.0.0.1;dbname=sakila", "root", "root");

    I noticed before that MySQL doesn’t always recognize Localhost and 127.0.0.1 to be the same

    # March 2, 2012 at 12:18 pm

    Nope – doh! I had a good feeling about that.

    # March 2, 2012 at 12:19 pm

    that work? try specifying it for localhost as well as 127.0.0.1

    # March 2, 2012 at 12:22 pm

    like this?


    $pdo = new PDO("mysql:host=127.0.0.1;dbname=sakila", "root", "root");
    $pdo = new PDO("mysql:host=localhost;dbname=sakila", "root", "root");
    # March 2, 2012 at 12:25 pm

    Nah that will crash, I mean, reset the password in phpmyadmin for both, then just use localhost in your code

    # March 2, 2012 at 12:31 pm

    nope…i reset all the passwords to ‘root’ for the three users and rebooted. No luck.

    Out of interest – have you tried using the exercise files on your end?

    # March 2, 2012 at 12:36 pm

    I use LAMP instead of WAMP
    Check out this thread, down the very bottom
    http://drupal.org/node/1059244

    Two people have different fixes for this issue

    # March 2, 2012 at 12:45 pm

    from i what i can see, they are essentially saying the same thing – change/reset the user passwords for the database.

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".