goatgirl Posted April 2, 2005 Posted April 2, 2005 (edited) I am trying to install WordPress to a subdomain using the instructions I found here. The error is: Error establishing a database connection This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. Are you sure you have the correct username and password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running? If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums. --------------------------------------------------- My wp-config.php is: <?php // ** MySQL settings ** // define('my-cpanel-name_database-name-I-created', 'wordpress'); // The name of the database define('my-cpanel-name_user-I-created', 'username'); // Your MySQL username define('password-I-created', 'password'); // ...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'); ?> --------------------------------- for the the fourth define, localhost, I have tried both leaving 'DB-HOST' and replacing it with 'localhost' - I still got the error message. When creating the database and user, I did remember (the second time) to add the user to the database. I even practiced by adding to users I will delete. After adding them, I get the connection strings for them, which means they are added to database, right? Any other suggestions on what could be wrong with the database connection? Thank you. GG Edited April 2, 2005 by goatgirl Quote
goatgirl Posted April 2, 2005 Author Posted April 2, 2005 Oops, I found the error. The instructions said: "For DB_NAME enter: cpanel-name_database-name-you-created" and I took that to mean REPLACE "DB_NAME" not replace "wordpress" with my info. Oh, well. Sorry to bother you all. Quote
TCH-Bruce Posted April 2, 2005 Posted April 2, 2005 When you created the database and user did you add the user to the database. Most often missed step. For user name use the format: cpanelname_user-you-created For host: localhost Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.