Joomla 2.5.1 Installation Error – Could not connect to the database. Connector returned number:2

by Elaine on February 8, 2012

This is my first time manually installing the new Joomla 2.5.1, I’ve installed Joomla 2.5.1 a couple times already on Bluehost with the SimpleScripts.  The only problem with Bluehost installation is that it doesn’t install the Sample Data even though I selected it to install it for me.  Anyways, so I chose to manually install on Dreamhost instead.   I encountered an error below but quickly was able to resolve it and get Joomla 2.5.1 installed on my website.

cmsmind dreamhost joomla25 db connect error 1 Joomla 2.5.1 Installation Error   Could not connect to the database.  Connector returned number:2

Dreamhost Joomla 2.5 Database Connection Error

When I got to Step 4 – Database, I entered the information and clicked ‘Next’ but got this error message:

Could not connect to the database.  Connector returned number : 2

This was a relatively easy fix.  Basically Joomla is saying that it could not find the MySQL database you created in Dreamhost.  So you should check your database details, or change the db user password if required.    This is assuming:

a:  You have a MySQL Database created

b.  You have a Database user created

High level Overview of how to fix

  • Check your Hostname in Dreamhost
  • Check MySQL Database Name, db User and db Password in Dreamhost
  • Enter Database Information in Joomla 2.5 Installation
cmsmind dreamhost joomla25 db connect error 2 Joomla 2.5.1 Installation Error   Could not connect to the database.  Connector returned number:2

Dreamhost - Check Hostname

1.  Check your Hostname in Dreamhost

  • Login to your Dreamhost Webhosting account
  • Click on ‘My SQL Databases’
  • Scroll down to see your ‘Hostname’.
  • For example:  My hostname = sql.cmsmind-joomla.com
cmsmind dreamhost joomla25 db connect error 3 Joomla 2.5.1 Installation Error   Could not connect to the database.  Connector returned number:2

Dreamhost Database Name and Database User

2.  Check MySQL Database Name, db User and db Password

  • Scroll down and see ‘Databases’ and click on your database user
  • For example:
      • My database name  = c_db1
      • My db User = cu1
  • In the window ‘My SQL Databases’, scroll down to the bottom where you see “Would you like to change cu1′s password?”
  • Enter in a new password and enter it in again
  • For example:
      • My new password = cmsmind
  • Click on ‘Modify cu1 now!’

3.  Enter Db Information in Joomla 2.5 installation

It takes Dreamhost about 10 minutes to change the password, so if you try again right away with the new information, it will not work.  So enter in the new database information in again after about 10 mins.

  • Resume your Joomla 2.5 Installation screen
  • Proceed to Step 4 – Database Configuration – Connection Settings
  • In the Basic Settings, set the following values that you entered above in Step 1 & 2
  • For example:
      • Database Type = Mysqli
      • Host Name = sql.cmsmind-joomla.com     (from step 1)
      • Username = cu1                       (from step 2)
      • Password = cmsmind            (from step 2)
      • Database Name = c_db1        (from step 2)
  • Click on ‘Next’
cmsmind dreamhost joomla25 db connect error 4 Joomla 2.5.1 Installation Error   Could not connect to the database.  Connector returned number:2

Joomla 2.5 Database Connection Screen

A side note, please use your own database information and hostname information.  The database information and hostname I showed in my examples are for this tutorial purpose only.  You will not be able to connect to my database with the information above.
Hope that helps,
 Joomla 2.5.1 Installation Error   Could not connect to the database.  Connector returned number:2

Elaine

Elaine is the founder of CmsMind, an online blog providing Joomla and Wordpress tutorials. Elaine lives in Toronto and when she is not online, she is either Marathon and Triathlon training or travelling and racing somewhere in the world. Find her also at: Save Money, Premium Themes and Templates, and at Webhosting Tips.

More Posts - Website

{ 9 comments… read them below or add one }

rioticx February 26, 2012 at 11:57 am

thanks brother!! very helpfull!!
sorry bad english

Reply

Elaine February 26, 2012 at 10:38 pm

Hi Rioticx,
No problem. Glad my post helped you.
Thanks for yiur visit,
Elaine

Reply

Doni April 16, 2012 at 4:09 pm

lol dude in the case your eyes failed horribly, Elaine is a WOMAN xD

Reply

David Woosley May 29, 2012 at 5:05 am

Thanks a million. I owe you one.

Reply

Gur ji June 19, 2012 at 5:13 pm

Hi , I’m new n joomla so , help me

Reply

Gur ji June 19, 2012 at 5:14 pm

I was having the same problem
Could not connect to the database. Connector returned number: 2

Reply

Isaac Dung October 30, 2012 at 9:22 am

I encountered the same error and these useful tips by Elaine helped me all the way.
Really helpful article Elaine. I will surely follow cmsminds.
Thanks.

Reply

maani April 25, 2013 at 10:22 am

thanks a lot!

Reply

Elaine April 26, 2013 at 3:23 pm

Hi Maani,
No problem!
Thanks
elaine

Reply

Leave a Comment

Captcha Captcha Reload

Older Post:

Newer Post: