2
votes

There's a lot of documentation on this but my troubleshooting has failed. I installed XAMPP for Windows which works fine but it is not working for my Mac OS Sierra.

My XAMPP version is 5.6.30-0 and my servers are running.

This is my wp-config.php details:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', ‘WP’);

/** MySQL database username */
define('DB_USER', ‘admin’);

/** MySQL database password */
define('DB_PASSWORD', ‘darkall’);

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

The user "admin" is a new user I created just for the "WP" database in phpMyAdmin. WP database exists in phpMyAdmin

I tried to go to http://localhost/wp/ but get the error "Error establishing a database connection""

1
Could you replace curly quotes between WP, admin, darkall with single quotes and see if that's the issue? - Cyto
Hi Cyto, Thank you very much for your reply. It worked. Apparently my Mac keyboard gives me those curly quotes by default. I should change that if possible. I do appreciate you prompt response /** The name of the database for WordPress */ define('DB_NAME', 'WP'); /** MySQL database username */ define('DB_USER', 'admin'); /** MySQL database password */ define('DB_PASSWORD', 'darkall'); - Samuel G. Ollor

1 Answers

3
votes

i think two problems may occur this problem:

1: Adding curly braces to your db name , db username , db password .. Replace them with ' ' single quotion mark.

2: The database username or password is not matching. Recheck the username and password of your database or reset user credentials and go with default username 'root' with empty password Like below :

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'WP');

/** MySQL database username */
define('DB_USER', ‘root’);

/** MySQL database password */
define('DB_PASSWORD', '');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

You can also check database credentials using php db connection .. create a file called conn.php and add below codes to your file :

<?php
$servername = "localhost";
$username = "admin";
$password = "darkall";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
echo "Connected successfully";
?>

If browser print "Connected successfully" then wordpress should work with this also.