Error establishing a database connection

Status
Not open for further replies.

Dazz

New Member
Messages
371
Reaction score
0
Points
0
Hi

Argh me again.

Trying to logon to my main Blog and getting this instead -
Error establishing a database connection


I'm using Wordpress and have another blog running under a sub-domain which is working fine.

Anyone got any ideas what's happened? Figured it must be something to do with Wordpress though I have no idea what it could be.

The address is http://dont-panic.elementfx.com or http://dont-panic-project.info

Thanks

Just removed the http://dont-panic-project.info addon domain incase this was the problem but still getting the error?
 
Last edited:

papichulo_carioco

Community Advocate
Community Support
Messages
1,400
Reaction score
12
Points
0
Did you check his configuration file to verify that the name of the DB user name and password the BD are well written?
 

Dazz

New Member
Messages
371
Reaction score
0
Points
0
I've checked out the wp-config.php file papichulo_carioco but it all seems fine to me, db username and password seem to be correct so does everything else.

Thanks for the quick reply.
 

papichulo_carioco

Community Advocate
Community Support
Messages
1,400
Reaction score
12
Points
0
Well I can not think of anything, unless you restore a previous copy of the DB to work. Sometimes it gets corrupted.
Unless you've tried to copy the DB directly from the local server, in which case you will fail because Word Press and the BD recording the details of your local server as localhost, root, root password, etc..
In that case it would be better to start again the installation of WP;)
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
You can try this...

Open wp-config.php and check...

Code:
define('DB_NAME', 'USERNAME_wordpress');

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

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

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

Make sure they are all correct.
Go to MySQLDatabases and verify the DB name, DB username and that user is attached to the DB.
If everything matches, try dropping the user and then re-creating him making sure the password is right.
 

Dazz

New Member
Messages
371
Reaction score
0
Points
0
Hmmm unfortunately I don't have any backup though when I tried to change the MySQL Hostname in wp-config.php from 'localhost' to 'mysql.stoli.x10hosting.com' I uploaded to get this error instead - Parse error: syntax error, unexpected $end in /home/dazz/public_html/wp-config.php on line 1

Really confusing me now :(

Will try your solution descalzo and see what happens. Thanks

Bum after ^ still getting the error as ^ this post :(
 
Last edited:

Dazz

New Member
Messages
371
Reaction score
0
Points
0
That would be odd since my other Wordpress site http://cashinblog.info is working fine and obviously is also working with MySQL.

This is why the message on my main blog is so confusing.

Thanks anyway jonathanyaniv.
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Mysql is currently down on Stoli (only) I believe, but it is very slow on other servers, too. So, no, it shouldn't have an effect on your site, hence why it is displaying properly.

Site looks good, by the way.
Mysql should be fixed soon. :)
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
I am on lotus but my site don't feel the slowness. It is loading rapidly. So till now the load on other servers are not too much to slowdown the the site loading times. :)

Hope the stoli fixed soon.
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
^No, pages load fine, and quite quickly, really.

Its just, as I said before (in another thread), backing up a database on a slow server really isn't doing me any favours. :)
 
Last edited:

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
^Should be, there was just an announcement in the service alerts forum.
 

Dazz

New Member
Messages
371
Reaction score
0
Points
0
Right mine didn't come back up so I figured there was a problem caused by me downloading and editing my wp-config.php file so this is what I did.

Downloaded wp-config-sample.php and renamed to wp-config.php without opening and then re-uploaded to server overwriting the one I'd originally edited.

Then I logged into cPanel and used legacy file manager to edit the file and add my MySQL database, username, password and host.

Saved file and reloaded website......... Success at last :)

Just thought I'd post before closing this thread incase anyone else has the same problem.
 
Status
Not open for further replies.
Top