Error Establishing a Database Connection

LPTechs

New member
Registered
Joined
Feb 21, 2018
Messages
13
Points
0
There will come a time in every website that uses a database life where you will see the error

"Error Establish a Database Connection"

Don't worry, this is more common than you think. All this means is (and I am sure you can guess by the error) that someone broke the connection from a configuration file or an index file to the database.

Here are a few things you want to check to get your Database and website connected again.

1. In most websites that are connecting to a Database, there will be some kind of configuration file or something that holds the credentials to connect to the database. The first thing you want to check is to make sure the name of the database in the configuration file is the same of the database you have created for this website. You can locate the name of the database file by going into your control panel or system panel for your account and finding the location of your "MySQL Databases." You will need to know this for the next options.

2. If you have confirmed that the database name is the same and correct, you want to make sure now that the password is synced correctly in the system. After locating where your "MySQL database" is, there will be an option that says "Password" or "Change Password." You will want to change this and save it in a safe spot. Go back into your configuration file and looks for something that says "pass" or "password" for your database. Replace the password in the quotation mark and hit save. You database password is now synced. You do not need to save the password in a password file or anything like that.

3. If you are still seeing the error after you have tried the above 2 options, then you want to make sure that the database IP is correct, or try another option to see if the system requires a different connection. You will see something that says "localhost." This is the most common type of connection to the database since it is on your local hosting provider's server. You can try to change this to "127.0.0.1" and see if the error is fixed.


If none of the options work, then you need to contacting the company that hosts your website and ask them to check the coding to make sure nothing is exploited or corrupted in the script.

Please let us know if you have any more questions.
 
Latest Threads
Replies
1
Views
19
Replies
0
Views
171
Replies
1
Views
37
Replies
2
Views
80

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top