Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

"Error: Failure to connect to database!" WordPress

  • SOLVED

I operate a real estate website and I've uploaded several properties over the last few years. While the live site continues to show all of these properties, in the back end database I am unable to see any of them and I get the following error message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'campus'@'localhost' (using password: YES) in /home/campus/public_html/wp-config2.php on line 3
Failed to connect to database!

I also get a message that says I need to upgrade to Wordpress 3.1 but when I try to upgrade I get an error message "Error: There was an error connecting to the server, Please verify the settings are correct."

I'm not that savvy with this stuff but I need help ASAP to get the problem fixed.

Answers (6)

2011-04-10

Rashad Aliyev answers:

Hello,

Please send your site credentials to my email.

best regards,

Rashad

2011-04-09

Michael Fields answers:

I am available to help immediately but will need access to your server. Please Email me through this site an we can start a dialog.

2011-04-09

Nathan Parikh answers:

If you could send me your FTP/WP login info, I'd be happy to take a look for you.

2011-04-09

Maor Barazany answers:

What was the last thing you did before this error has occurred?

What system or plugin do you use for the properties? the wp-config2.php is not a default WP file.

Have you changed any passwords or so?

If you want I can help you now, but also need access to your FTP and database , need the uesername/password for logging in, you can mail me to maor [at] maorb.info or through the site here.

2011-04-09

Duncan O'Neill answers:

Hi Brian,

Lacking more information, here's a suggestion: try reverting to wp-config.php ( I see you're using wp-config2.php ) and see if that gets access.

In your /wp-load.php file, replace wp-config2.php with wp-config.php. If that lets you in then replace the relevant settings. i.e. replace the settings in wp-config2.php with those in wp-config.php which worked. Or just keep using wp-config.php.

2011-04-09

Monster Coder answers:

Hi,
It might be that you've uploaded a local version of wp-config2.php file. You simply need to put the correct database configuratins in wp-config2.php. Please also check for a while wp-config.php. There is a slight chance that this file exists and which will hold your correct db config. In that case, copy the DB_NAME, DB_USER, DB_PASSWORD and DB_HOST from wp-config.php to wp-config2.php.

If you don't know current db user and password, create a new one and put them. Also drop all other privileges from your database for security issue.

What tense me that you said no data is available at backend which does not smell good. May be your site was compromised.

If you provide access, I can look into it.

Thanks