Page 1 of 1

i got an error establishing a database connection

PostPosted: 13. March 2011 22:31
by Scheath666
when i recieve this, it was saying either my WP-config file is incorrect or the database server is down. i don't know what to do next please help!

any suggestions are appreciated

Re: i got an error establishing a database connection

PostPosted: 13. March 2011 23:42
by Altrea
check if your SQL Server is down
check if you can login with your login Data in any mysql admin tool (e.g. phpmyadmin)
check if your wp-config file is correct

Re: i got an error establishing a database connection

PostPosted: 13. March 2011 23:58
by xfsgpr
Apart from what Altrea has said, you also need to get these settingsright in your WP-Config file:

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

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

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

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


Also make sure you have already created the database wordress before running the setup process.

hth

Re: i got an error establishing a database connection

PostPosted: 14. March 2011 22:53
by Scheath666
Ah I c, for the db user it was set to "root" next to it I dunno if that suppose to change and I may have check the mysql as well

Re: i got an error establishing a database connection

PostPosted: 15. March 2011 19:00
by Scheath666
I have found that mysql server was down and it seem I was able to get t to start again but the problem seem to be the same though.

Re: i got an error establishing a database connection

PostPosted: 15. March 2011 21:16
by Scheath666
After uninstalling and reinstalling and reach to the point of wordpress login and it asked me to download this install.php file and i dunno what to do with it.

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en-US">
<head>
   <title> &rsaquo; Log In</title>
   <meta http-equiv="Content-Type" content="; charset=UTF-8" />
<link rel='stylesheet' id='login-css'  href='http://localhost/wordpress/wp-login.php/wp-admin/css/login.css?ver=20110121' type='text/css' media='all' />
<link rel='stylesheet' id='colors-fresh-css'  href='http://localhost/wordpress/wp-login.php/wp-admin/css/colors-fresh.css?ver=20110121' type='text/css' media='all' />
<meta name='robots' content='noindex,nofollow' />
</head>
<body class="login">
<div id="login"><h1><a href="http://wordpress.org/" title="Powered by WordPress"></a></h1>

<form name="loginform" id="loginform" action="/wp-login.php" method="post">
   <p>
      <label>Username<br />
      <input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
   </p>
   <p>
      <label>Password<br />
      <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
   </p>
   <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
   <p class="submit">
      <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
      <input type="hidden" name="redirect_to" value="/wp-admin/" />
      <input type="hidden" name="testcookie" value="1" />
   </p>
</form>

<p id="nav">
<a href="/wp-login.php?action=lostpassword" title="Password Lost and Found">Lost your password?</a>
</p>
</div>
<p id="backtoblog"><a href="/" title="Are you lost?">&larr; Back to </a></p>

<script type="text/javascript">
function wp_attempt_focus(){
setTimeout( function(){ try{
d = document.getElementById('user_login');
d.focus();
d.select();
} catch(e){}
}, 200);
}

wp_attempt_focus();
if(typeof wpOnload=='function')wpOnload();
</script>
</body>
</html>


because of this, it was creating a loophole, preventing me to log in