Google App Engine local WordPress install error with MAMP

I’m trying to set-up WordPress to run on Google App Engine.

I’m following the docs over here with MAMP as my local dev environment. The app runs okay through the GAE Launcher, but when I browse the localhost:PORT, I get:

Read More

Error establishing a database connection

I’ve tried changing the define('DB_HOST','localhost'); value to localhost:3306 (my MAMP MySQL port), 127.0.0.1, and even the socket address (:/Applications/MAMP/tmp/mysql/mysql.sock) – but I can’t get past the database connection error.

I’m wondering if I have misinterpreted the instructions. I originally thought that the database name, username and password were just placeholders that one was supposed to customize, both in Step 3 (create database and user) and 4 (edit config file). But, hoping I could run it remotely on App Engine, I looked at their sample SQL they use to set up the database and they’re using the generic terms (wp_user, wp_password) in their SQL stored in Cloud Storage. Does anyone know what is the correct procedure?

I’m seriously stuck. Can someone help?

Related posts

Leave a Reply

3 comments

  1. Try the following:

    1. Remove the ** from DB_NAME, DB_USER and DB_PASSWORD, i.e. use:

      define('DB_NAME', 'wordpress_db');
      
      /** MySQL database username */
      define('DB_USER', 'wp_user');
      
      /** MySQL database password */
      define('DB_PASSWORD', 'wp_password');
      
    2. When you create your user in MySQL, make sure you use the @localhost terminology as shown.

    3. If all else fails, start with WordPress 3.5.1.

  2. I found a better way of creating a database by following this video by Google Developers.

    If you use MAMP, go to terminal and type

    /Applications/MAMP/Library/bin/mysql --host=ipaddressOfCloudSQL -uroot -ppassword
    

    Once you login, you can follow the rest of the instructions as follows.

  3. I don’t know if you still have this issue, but this is an issue of where the app SDK is looking for the file MYSQL sockets file (mysql.sock). I’m not sure where whether you can configure this somehow, but this worked for me since the default folder that the SDK looks for the file is /tmp:

    cd /tmp
    ln -s /Applications/MAMP/tmp/mysql/mysql.sock mysql.sock
    

    If you simply link the MAMP sockets files to the one that google’s app engine expects locally, it works. 🙂