dil_bert Posted April 27, 2019 Share Posted April 27, 2019 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 Quote Link to comment https://forums.phpfreaks.com/topic/308648-error-establishing-a-database-connection/ Share on other sites More sharing options...
dil_bert Posted April 28, 2019 Author Share Posted April 28, 2019 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 Quote Link to comment https://forums.phpfreaks.com/topic/308648-error-establishing-a-database-connection/#findComment-1566351 Share on other sites More sharing options...
gizmola Posted April 29, 2019 Share Posted April 29, 2019 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. Quote Link to comment https://forums.phpfreaks.com/topic/308648-error-establishing-a-database-connection/#findComment-1566361 Share on other sites More sharing options...
mac_gyver Posted April 29, 2019 Share Posted April 29, 2019 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. Quote Link to comment https://forums.phpfreaks.com/topic/308648-error-establishing-a-database-connection/#findComment-1566362 Share on other sites More sharing options...
dil_bert Posted May 3, 2019 Author Share Posted May 3, 2019 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 Quote Link to comment https://forums.phpfreaks.com/topic/308648-error-establishing-a-database-connection/#findComment-1566435 Share on other sites More sharing options...
dil_bert Posted May 7, 2019 Author Share Posted May 7, 2019 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 Quote Link to comment https://forums.phpfreaks.com/topic/308648-error-establishing-a-database-connection/#findComment-1566503 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.