No, line #4 in the CORRECTLY edited wp-config.php file can NOT be that.
It is not about source code!
It is about what you did in the wp-config.php file.
Review the instructions:
http://codex.wordpress.org/Installing_WordPress#Step_3:_Set_up_wp-config.php
Thread Starter
ady20
(@ady20)
Well, trust me i have review this intructions for a several time,
but nothing, the same error.
This is my config.php file:
<?php
// ** MySQL settings ** //
$dbh = mysql_connect(“hostname”, “username”, “<PASSWORD HERE>”) or die (“message”);
mysql select db1(“databasename”);
// Change SECRET_KEY to a unique phrase. You won’t have to remember it later,
// so make it long and complicated. You can visit https://www.grc.com/passwords.htm
// to get a phrase generated for you, or just make something up.
define(‘SECRET_KEY’, ‘*******’); // Change this to a unique phrase.
// You can have multiple installations in one database if you give each a unique prefix
$table_prefix = ‘wp_’; // Only numbers, letters, and underscores please!
// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-content/languages.
// For example, install de.mo to wp-content/languages and set WPLANG to ‘de’
// to enable German language support.
define (‘WPLANG’, ”);
/* That’s all, stop editing! Happy blogging. */
define(‘ABSPATH’, dirname(__FILE__).’/’);
require_once(ABSPATH.’wp-settings.php’);
?>
I rename the file wp-config-sample.php to wp-config.php.
This is absolutely wrong:
$dbh = mysql_connect("hostname", "username", "<PASSWORD HERE>") or die ("message");
mysql select db1("databasename");
I don’t know how did you “review” the instructions and what did you see because it says clearly what to do:
// ** MySQL settings ** //
define('DB_NAME', 'putyourdbnamehere'); // The name of the database
define('DB_USER', 'usernamehere'); // Your MySQL username
define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
define('DB_HOST', 'localhost'); //
Just stop trying to be smarter! Do it exactly as it says:
Do NOT change anything, just type in your username where it says “usernamehere” etc. – do NOT touch anything else!
Thread Starter
ady20
(@ady20)
Well, now i do exactly as you say,but surpise: Error establishing a database connection. i checked and double checked the config.php,the date are corectly write to this file.
I forgot to tell somethig:i used a free hosting, could be this a problem ??
// ** MySQL settings ** //
define('DB_NAME', 'databasename'); // The name of the database
define('DB_USER', 'username'); // Your MySQL username
define('DB_PASSWORD', 'PASSWORD'); // ...and password
define('DB_HOST', 'hostname'); //
databasename, username, PASSWORD, hostname – are only placeholders.
But you will have to replace those “placeholders” with the REAL data from your own host!
Thread Starter
ady20
(@ady20)
Of course i have replace whit my real data,but whit no succes.She give the same message :Error establishing a database connection.
I have cheked,double checked and triple checked my data to be write corectly,but nothing….the same error. i don’t know what to do….
Well, despite what you think… in 99.99% of the cases it is a user error: a space, a missing quote [‘], wrong quote (when using bad editors) and so on.
Thread Starter
ady20
(@ady20)
Thank’s alot for advice , i have resolve the problem.