Error establishing a database connection
-
I’m new to WordPress, and actually new to databases and php in general.
For some reason I can’t seem to get my config file right, because every time I try going to the install file I get a “Error establishing a database connection” error.
I created a database in mysql and a user account with all permissions enabled. I uploaded WordPress to a “test” directory folder seperate from my site *i.e. https://blah.net/blah/testfolder*. In the config file I followed the read me and in file instructions and entered the database name, username, and password. When it didn’t work I tried changing the host location from localhost to the actual hosts address for my database, and that didn’t work either.
My config file basically looks like this:
‘CODE'<?php
// ** MySQL settings ** //
define(‘DB_NAME’, ‘hostname_databasename’); // The name of the database
define(‘DB_USER’, ‘hostname_username’); // Your MySQL username
define(‘DB_PASSWORD’, ‘hostname_userpassword’); // …and password
define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value// Change the prefix if you want to have multiple blogs in a single database.
$table_prefix = ‘wp_’; // example: ‘wp_’ or ‘b2’ or ‘mylogin_’// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to ‘de’
// to enable German language support.
define (‘WPLANG’, ”);/* Stop editing */
define(‘ABSPATH’, dirname(__FILE__).’/’);
require_once(ABSPATH.’wp-settings.php’);
?>’/CODE’
- The topic ‘Error establishing a database connection’ is closed to new replies.