Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

Christopher Anderton on "MAMP Error Establishing database connection"

$
0
0

Cheers.

Did you edit wp-config-sample.php and the renamed it to ”wp-config.php”? I know it seems silly, but sometimes even the best could do that misstake and forget this.

If the file name is correct, then there is something wrong with the settings.

Here is a wp-config.php sample file (on a MAMP install, but applies to all installs):
http://pastebin.com/mZ1VKE7f

The important parts is database settings and the database table.

define( 'DB_NAME', 'mydatabase' );   // Your database name
define( 'DB_USER', 'root' );     // Never use this on a live site
define( 'DB_PASSWORD', 'root' );  // Never use this on a live site
define( 'DB_HOST', 'localhost' ); // MAMP and others 'localhost'

and:
$table_prefix = 'wp_myproject'; // WordPress takes care of adding this to the db

For creating the DB (ok, we are doing this in a reverse order):

1. Go to: http://localhost:8888/phpMyAdmin/ (Using a standard URL if you have the install at port 8888)

2. Create database (image link)
https://dl.dropboxusercontent.com/u/17959832/database1.png

3. Add user (image link) if this is set, skip to 4.
https://dl.dropboxusercontent.com/u/17959832/database2.png

4. Now it should look like this (the row with "root", the rest of itcan we ignore for this)
https://dl.dropboxusercontent.com/u/17959832/database3.png

Now the install should be set up.
Point the browser to where your site is i.e. http://localhost:8888/myproject

You may of course know the steps, but others may stumble upon this thread that don't.
Let me know how it goes!


Viewing all articles
Browse latest Browse all 5527

Trending Articles