InMotion Hosting Support Center

Joomla 2.5 has reached its end of life as for 12/31/2014. Please be advised this may be a security risk to your website. You can view more information about the end of life here.


Joomla 2.5 utilizes a database to store a majority of a site's content. For example, if you write a new article in Joomla, the article is written to the database. As the database is vital for Joomla to run, if Joomla cannot connect to your database and access information, you will see database related error messages on your site. In this article, we'll show you a few common errors and how you can resolve them.

Common Joomla 2.5 Database Connection Error Messages:

Database connection error (2): Could not connect to MySQL.

database-connection-error-2-could-not-connect-to-mysql

Problem:
This error message generally means that your Joomla's configuration.php file has either the wrong database name or database username. In our testing environment, we changed both the database username and password, and in each separate occasion the same error message occurred.

Solution:
You should review your configuration.php file and ensure you are using the correct MySQL username and password. These settings will appear in the file as:

public $user = 'userna5_dbuser';
public $password = 'dbpass';

If you are sure the settings are correct, it is recommend to reset your database user's password and update your configuration.php file with the new password. This will help ensure that you have the correct database password set.

Database connection error (3): Could not connect to database

database-connection-error-3-could-not-connnect-to-database

Problem:
This error message usually means that you are connecting to the wrong database server. For most Joomla installations, the joomla files themselves and the database it connects to are on the same server. When this is the case, "localhost" should be used the database server. We recreated this error message by setting the database host to "localhosttt" (localhost spelled wrong).

Solution:
If your Joomla site is setup like most, check your configuration.php file and ensure your database host is set to "localhost". This is setting looks like the following in your config file:

public $host = 'localhost';

MySQL server has gone away

mysql-server-has-gone-away

Problem:
The "MySQL server has gone away" error generally means that there is a problem with MySQL on the server, therefor it is unavailable for use. In our testing environment, we shut down MySQL and received such a warning.

Solution:
If you are not an InMotion Hosting customer, you should contact your current web hosting provider with the necessary details for more help with this. At InMotion Hosting, we monitor our servers 24 hours a day. If MySQL is not functioning on a server, we are aware usually seconds after the issue occurs. You can rest assured we are on top of the problem and that it should be corrected shortly. As always, you can contact our Support Team if you desire to report such a problem.

Most often, if Joomla has been working fine and suddenly stops working due to a database error, there is a problem with the database on your server. You'll want to contact your hosting provider for further assistance. If you have recently made a change to Joomla and then you begin to see database errors, instead of contacting your host you should first check your database settings in your configuration.php file.

Continued Education in Course 212: Joomla 2.5 Advanced Database Information
You are viewing Section 4: Joomla database connection error (2): could not connect to mysql
Section 3: How to change your Joomla 2.5 database username and password

Joomla Community Google+ Hangout #3

June 3rd, 2014

Thank you @RustyJoomla for letting me speak on the Joomla Community Google+ Hangout!

Click here to watch!

Support Center Login

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
2013-01-25 2:26 am
i had Database connection error (2): Could not connect to MySQL.
After following ur article it works...
Thank u sooo much n...Thanks a lot..
May God bless u with full grace..
n/a Points
2014-03-18 8:47 am

I'm very grateful because your site help-me. Thanks a lot.

n/a Points
2014-03-25 3:27 am

Thanks. Why this error comes even when there is no change in MySQL db.  The fact is that if you open the site ,It is opeing at first and then when I am refreshing it 3-4 times that error is coming. Plz help. You  can check the error at my site at www.lifeinglife.com    Thanks in advance

Staff
11,186 Points
2014-03-25 8:04 am
I was unable to produce any errors on your site so it appears to be just a previous intermittent issue that is now resolved.
n/a Points
2014-04-13 4:26 pm

Very useful and resourceful, helped me save so much time figuring out the cause of the error..Thanks so so much..

Much appreciation:)

n/a Points
2014-06-13 10:12 am

Excelente, muchas gracias por la solución.

n/a Points
2014-06-18 12:30 pm

please help

www.edibledesignimages.com

Database connection error (2): Could not connect to MySQL.

Staff
25,386 Points
2014-06-18 1:32 pm
Hello Carolina,

I'm sorry to hear you're having problems with connecting to your Joomla database. Unfortunately, you have given us no details with which to help you. Have you at least gone through the steps above and checked to see that the correct user name and password are being used for the database. One way to check is to use the database program that comes with your hosting. Since it doesn't appear that you're hosted with our service, we can't really check from here. You can reference our article on connecting to a database with MySQL workbench for further information on testing (using a different program).

I hope this helps give you at least a starting point. If you wish for us to investigate the issue further, we need further information on how you're connecting to the database.

Regards,
Arnel C.
n/a Points
2014-07-21 5:18 am

I'm very grateful because your site help-me. Thanks a lot. May Allah bless u with full grace

n/a Points
2014-09-03 3:24 am

Database connection error (2): Could not connect to MySQL. my joomla website was working very fine but after i have inserted the module for cintact suddely it started to show me that it cant connect to the database.....izt a module or server it self

Staff
17,031 Points
2014-09-03 11:28 am
Hello Maanda,

Thank you for your question. This could be caused by an issue with your server's services, or a misconfiguration of your database settings.

I first recommend reading our detailed guide database connection errors.

We would be happy to further assist you, but will need additional information such as the domain name of the site, and a link to the error message.

If you have any further questions, feel free to post them below.

Thank you,
John-Paul
n/a Points
2014-09-04 12:22 pm

Hey guys, thats for the page it's been really usefule although  I've tried to follow the steps which are great but when I click on the link reviewing the php file and it asks me to go to the administrator page I get the same SQL error as I do on my homepage which means I can't access the admin section to correct the configuration.php content. Any ideas?

URL: http://www.mixedmartialartsden.com/

 

Thanks a lot,

 

Victor

Staff
11,186 Points
2014-09-04 12:31 pm
To adjust the configuration.php file, you would do so within the cPanel File Manager which is available without any access to the Joomla Administration panel.
n/a Points
2014-12-14 5:00 am

Please help me :

www.constantin-chirita.ro

Thank you

Constantin Chirita

Staff
28,219 Points
2014-12-15 10:13 am
Hello Constantin,

I see your site has the same error as described in the article. Have you followed the instructions? If so, where are you stuck?

Kindest Regards,
Scott M
n/a Points
2015-01-12 7:55 am

i've done all u said more than one but problem still  here >>plz help me

 

Staff
25,386 Points
2015-01-12 10:00 am
Hello Nansi,

Sorry for the problem that you're having. However, you have not provided any details to the issue, so we can't help you without any further information. Please describe the problem, provide details on any error messages, and explain steps that you take to duplicate the error. If you can provide us a URL or other information on the website, it would also help us (if you are a customer).

Kindest regards,
Arnel C.
n/a Points
2015-01-20 3:26 am

This article is good. Hands on approach to resolving errors. It helped me solvemine and my site is now up and running.

 

n/a Points
2015-04-03 5:00 am

I need help with this error pls:

Got error 28 from storage engine SQL=SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up, a.publish_down, a.attribs, a.metadata, a.metakey, a.metadesc...

Staff
25,386 Points
2015-04-03 1:13 pm
Hello Yahaya,

Sorry to hear that you're getting an error with your database. The error you're seeing is not related to a connection issue. It's more related to the space you have available for your database. I researched the error and it is related to the space available to the database or temporary files. You may need to speak with your hosting provider technical support. If InMotion Hosting is your host, then you will need to submit a support ticket to live support. You may also want to check the size of your database and use the cPanel option to repair it to see if it will help.

I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

20 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!