Jump to content

Error establishing a database connection


dil_bert

Recommended Posts

hello dear experts, 

 

got troubles with a wordpress- site

after having  a site down for quite a  long time i opened the the server by setting the permissions on the folder of the site_;:

then  requested it via browsesr and got back Error establishing a database connection

what may have happened here!? 

love to hear from you
 

Link to comment
Share on other sites

hello after doing some research i found out the possible options...

well it is a wordpress-site i am talking about... here some musings on the issues

the database is corrupted. some things could cause issues in the WordPress database to become corrupted,  - eg. from uploading a bad plugin

 - the server which hosts the database may be  down for some reasons. the database’s server may be down due to some issues or problems or errors

Thirdly - some extra errors may cause the issues.

login credentials for the database are wrong.  eg possiblie the database uses separate login credentials (username and password). 

will have a closer look and come back and report all the findings

Link to comment
Share on other sites

I tend to start by verification of the username and password using the mysql command line client.  Do the credentials work?  

If the db is on a separate non localhost server (-h someserver.someplace ) then this will help you debug that issue.  

Many things in PHP having to do with mysql connectivity have changed in recent years, not the least of which is the removal of the mysql_ library which old versions of wordpress used.  Assuming PHP has been upgraded on the server, but wordpress has not, it is quite likely that upgrading wordpress to a current version will fix the issue.

Of course, make sure you have full and complete OS and database backups before you start down that road.

Link to comment
Share on other sites

good day dear gizmola and Mac_gyver

 

many many thanks for the answer and for sharing your ideas. I will digg deeper into all of those.

 

I have switched MySQL of and on - via the backend. With now effects. It still is the same thing:

 

this is a good idea:

 
Quote


 

your php installation needs to be set up to log all php errors. there should be information in the web server error log file to help identify the problem.

 

 

will have a closer look!

 

Quote

 

If the db is on a separate non localhost server (-h someserver.someplace ) then this will help you debug that issue-


 

yes it is on a non local server..
 

Quote


Many things in PHP having to do with mysql connectivity have changed in recent years, not the least of which is the removal of the mysql_ library which old versions of wordpress used.  Assuming PHP has been upgraded on the server, but wordpress has not, it is quite likely that upgrading wordpress to a current version will fix the issue.


 

many thanks - will discuss all these ideas with my server-admin.

 

have a great day

Link to comment
Share on other sites

 
according this text - it could be themerelated or plug-related..
 
 
https://websitesetup.org/error-establishing-a-database-connection/
 
If the error message is the same on both pages “Error establishing a database connection”, then proceed onto the next step. ... The database may need to be repaired”, then you need to repair your database. You can do this by adding the following line in your wp-config.php file. Add it just before 'That's all, stop editing!01.03.2019
 
https://websitesetup.org/error-establishing-a-database-connection/
 
Step 2: Check If Your Plugin or Theme Files Haven’t Been Corrupted
Your WordPress files might get corrupted as a result of a couple of misfortunate events.
 
For instance, maybe you’ve updated a plugin or a theme, and the whole thing collapsed? Maybe you hooked the site up to an external service? Maybe you hand-edited some of the files?
If any of the above ring a bell, you probably have your culprit. If you haven’t done any of that, skip this step.
 
Here’s what you can do:
1. First, connect to your host via FTP. You can do this with a free tool called FileZilla.
In order to connect, you need a login and a password to your FTP account. If you don’t know what/where those are, the easiest way to get them is to search through the initial emails that you got from your web host when you first signed up. Alternatively, you can ask the live chat support representative to give you those details.
 
Having them, connect to the server and navigate to the WordPress root folder. It’s usually called “public_html” or “www” or you might be in it already once you establish the FTP connection.
 
The rule of thumb is that if you can see sub-folders like “wp-content” and “wp-admin” then you’re in the WordPress root. Example:
 
WordPress root
2. Go into “wp-content” and rename the “plugins” folder to something else (whichever other names, as long as it’s not “plugins”):
rename plugins
 
3. Go back to your site and see if the error is still there.
If not, you now know that it’s been caused by some plugin. Go back to FTP, rename the folder back to “plugins”. Go in it, and change the folder names of the individual plugins, one by one. The easiest way to do this is to add an underscore at the end: “_”
 
name changed
 
Keep coming back to your site to see when the error gets triggered or vanishes. Once you’ve narrowed it down to one specific plugin, you have found the troublemaker. Either delete it or go online to see if the solution has been documented.
 
If the error is still there even after renaming the “plugins” folder, go through the exact same process with the “themes” folder.If that doesn’t help, rename both folders back to “plugins” and “themes”. The error is caused by something else.
Step 3: Check If---.....
 
i am gonna check this out
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.