Could not connect to the database.Connector returned number2

Joomla versions 2.5, 1.7 and 1.6 are all end-of-life since December 31st 2014 and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
frniners
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Oct 17, 2009 1:13 pm

Could not connect to the database.Connector returned number2

Post by frniners » Tue Jul 26, 2011 1:16 pm

Please help me on the above error i get when setting up my setting up the database configuration.

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12781
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Could not connect to the database.Connector returned num

Post by brian » Tue Jul 26, 2011 4:17 pm

This is caused by you inputting the incorrect database details. Either the host or username/password are incorrect
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

vizzzy
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Mon Dec 06, 2010 10:40 am
Location: Amsterdam, The Netherlands

Re: Could not connect to the database.Connector returned num

Post by vizzzy » Thu Jul 28, 2011 10:48 am

I assume you might have used the name 'joomla' for database name.that would have caused the problem.
some hosts wouldn't allow you to use this name(may be certain names).
Try using some other name.that should do.

cheers

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12781
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Could not connect to the database.Connector returned num

Post by brian » Thu Jul 28, 2011 11:16 am

Sorry vizzzy but that is just not correct
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

amin_eshgh
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jul 28, 2011 10:44 am

Re: Could not connect to the database.Connector returned num

Post by amin_eshgh » Thu Jul 28, 2011 2:55 pm

remove the password and continue it may be helpful

vizzzy
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Mon Dec 06, 2010 10:40 am
Location: Amsterdam, The Netherlands

Re: Could not connect to the database.Connector returned num

Post by vizzzy » Fri Jul 29, 2011 1:55 pm

brian wrote:Sorry vizzzy but that is just not correct
well may be...but it does do the job...(at-least for me)

nyceandcool
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jul 20, 2011 2:26 pm

Re: Could not connect to the database.Connector returned num

Post by nyceandcool » Thu Jan 05, 2012 2:17 pm

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

I used the following settings


Database Type *

Host Name *
"localhost"
Username *
root
Password
root
Database Name *
j17
Table Prefix *
joo

The change i made was adding Password as root i am using a localhost

liammaca
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jan 05, 2012 4:35 pm

Re: Could not connect to the database.Connector returned num

Post by liammaca » Thu Jan 05, 2012 4:43 pm

I have the same problem and none of the previous replies have helped.

Can anyone else help Please ?

Thanks

wsidt73
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Mon Apr 05, 2010 7:31 am

Re: Could not connect to the database.Connector returned num

Post by wsidt73 » Thu Jan 05, 2012 7:12 pm

Have you spoken to your host provider? They may be able to help.

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Fri Jan 06, 2012 11:20 am

liammaca wrote:I have the same problem and none of the previous replies have helped.

Can anyone else help Please ?

Thanks
Are you trying to upload to a host or a localserver? Either way if you get the "Could not connect to the database. Connector returned number: 2" then you are entering the wrong details in the DB config window. Check very carefully.
If the above is not your actual problem then what is your problem?

Birendra
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Jan 07, 2012 8:33 am

Re: Could not connect to the database.Connector returned num

Post by Birendra » Sat Jan 07, 2012 8:50 am

1.Open your XAMPP control panel
2.Under MySQL click the admin tab, then you'll get a web page with some thing called PHPAdmin
3.On the right corner under MySQL check your user name and password
4.Use that user name and password for the installation (user name should be without @localhost)
5.If you dont see a password then leave the password blank

It worked for me :geek:

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Sun Jan 08, 2012 10:23 am

I had this by email:
Hi Mitchell,

Thank you for that tip.

The problem I have, for starters, is multiple H1 tags....and some of the h1
tags are blank so its messing up my SEO. I also have <h3> categories </h)
inside each page. These issues are coming from the html code heading.

Are you able to tell me the steps to fix?

Everet
It had this thread as a Heading. I tried to send an email reply but it was returned
[email protected]
<[email protected]>:
Sorry, we were unable to deliver your message to the following address.

Will "Everet" please identify him or her self as there is no one on this thread of that name!?
I have no idea what tip they are talking about!

eavary
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 08, 2007 1:04 am

Re: Could not connect to the database.Connector returned num

Post by eavary » Wed Jan 18, 2012 6:26 pm

Not sure if this will help others because I'm having a hard time accepting that it worked...

Try explicitly stating the port number in the host field, even if it's the default port, like so:

<host>:<port>

where host and port are the host and port on the server.

Hope this helps

nanani
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sat Jul 02, 2011 11:43 pm

Re: Could not connect to the database.Connector returned num

Post by nanani » Sun Feb 05, 2012 7:50 pm

Hi, I am new to joomla and recently tried to get started on joomla 1.7. where I had the same problem. After deinstalling everything and reinstalling - we found it was somehow related to the name but I am no techie and we don't know why. Just today we are going on 2.5. and the same problem again but a SOLUTION: the username was case sensitive ... and it worked.

Maffu
Joomla! Intern
Joomla! Intern
Posts: 60
Joined: Tue Jul 18, 2006 10:52 am

Re: Could not connect to the database.Connector returned num

Post by Maffu » Fri Feb 24, 2012 3:08 pm

For those still having trouble -
Installing 2.5.1 on WAMP 2.2 on my local machine, I bashed my head against this for hours before finally changing the hostname in a last desperate effort.
Forget using "localhost" or "127.0.0.1", the only thing that got me past this screen was to use the Windows computer name, i.e. the one you see listed under Computer Name when you press [Windows Key]+[Pause/Break].
Hope that helps.

chaz2000
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Oct 12, 2011 3:07 pm

Re: Could not connect to the database.Connector returned num

Post by chaz2000 » Fri Feb 24, 2012 3:49 pm

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

I used the following settings


Database Type *

Host Name *
"localhost"
Username *
root
Password
root
Database Name *
j17
Table Prefix *
joo

The change i made was adding Password as root i am using a localhost
I believe there is a note to the side of the Table Prefix during installation that says that you have to put an underbar "_" after the name.

chaz2000
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Oct 12, 2011 3:07 pm

Re: Could not connect to the database.Connector returned num

Post by chaz2000 » Fri Feb 24, 2012 3:54 pm

amin_eshgh wrote:remove the password and continue it may be helpful
I removed the password and was able to finish the install. However, I tried to login and joomla wouldn't let me log in without a password. I went back into myAdmin and added a password to my user and it still won't let me in.

Ideas?

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Fri Feb 24, 2012 6:46 pm

The admin password that you need is nothing to do with the database. You need the password you created when you filled in the details of the site. You put in a User name and password, thats what you need to login to the backend. No need to reinstall anything, Go to page 6 of my Guide. All the help you need is there, did you not follow it as I suggested in my earlier post, it make special reference to saving this user name and password. Read it through and all will be clear!

chaz2000
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Oct 12, 2011 3:07 pm

Re: Could not connect to the database.Connector returned num

Post by chaz2000 » Fri Feb 24, 2012 7:56 pm

mitchell65 wrote:The admin password that you need is nothing to do with the database. You need the password you created when you filled in the details of the site. You put in a User name and password, thats what you need to login to the backend. No need to reinstall anything, Go to page 6 of my Guide. All the help you need is there, did you not follow it as I suggested in my earlier post, it make special reference to saving this user name and password. Read it through and all will be clear!
John,
I found the problem - this was my first local installation. I normally use a different name for username on website installs and didn't realize I left "Admin" for this one, and yes, I forgot to write it down.
(I'm not jest a mimber of the ideiot clubb, I'm the prezidint. Ha ha)

By the way, I got an error when I typed in "localhost/test/administrator" (no quotes), but localhost/joomla/administrator brings up the login module.

Thanks for your dedication and sharing.

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Sat Feb 25, 2012 8:18 am

By the way, I got an error when I typed in "localhost/test/administrator" (no quotes), but localhost/joomla/administrator brings up the login module.
Then originally instead of creating a folder in the www folder of Wamp named "test" you must have named the folder "joomla". I matters not what you name it so long as you remember it when filling in the address bar of your browser!

Obievil
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Sep 24, 2009 9:49 pm

Re: Could not connect to the database.Connector returned num

Post by Obievil » Sat Feb 25, 2012 6:38 pm

I've done all of the above and I'm getting the same error. However, the slight difference with mine is that I'm trying to upgrade to an existing data base. I can get into it and do query's to it through php myadmin. There's no password listed.

phpmyadmin shows my database being _Joomla so that's what I've put in. I've tried my username with and without the underscore.


My development group moved our forums from a localhost server in germany to my remote host server state side. He gave me the var/etc folders and the database. I altered the configuration.php and it still fails to connect. IDeally I'd like to preserve contact and log information for users but at this point I'm so annoyed with it, because I'd have to get it running and upgrade anyway, that I figured i'd just install new.

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Sat Feb 25, 2012 7:23 pm

My development group moved our forums from a localhost server in germany to my remote host server state side.
How did they "move" the site. The best way to do thatis to use Akeeba backup and the Kickstart applet. I don't understand what you mean by "I'm trying to upgrade to an existing data base."

Obievil
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Sep 24, 2009 9:49 pm

Re: Could not connect to the database.Connector returned num

Post by Obievil » Sat Feb 25, 2012 7:41 pm

mitchell65 wrote:
My development group moved our forums from a localhost server in germany to my remote host server state side.
How did they "move" the site. The best way to do thatis to use Akeeba backup and the Kickstart applet. I don't understand what you mean by "I'm trying to upgrade to an existing data base."

he did an export of the database and a File .gz archive of the /var and /etc folders and gave them to me.

The database has all of the user data as well as some content from the forums that we'd need to have. However, I do not think it's useable in it's current state because even with the files and the authentications data, it still cannot connect to the database.


which is why I was looking to do a new install and upgrade the old database, if it was possible. If not I'll just do a new install.

Neither option are working for me right now and I'm a touch frustrated.

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Sun Feb 26, 2012 10:22 am

I would recommend that you go back to the developer and ask him to download Akeeba and make a backup of the site. This will backup all of the site details and the database. This will come as JPA compressed files/s. The number of files will depend on the size of the site, it may well be only one file. Have him send you that file/s and then you can FTP that file/s to your server, download the Kickstart applet from Akeeba and use that to install the site on your server. You will probably need to create a database on your server and it is VERY important to copy and paste the Server name, the user name, the password and the Database name very, very carefully. One very small mistake in any of these will attract the "Unable to connect to database error No2".
Come back here for any further help you may need.

Obievil
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Sep 24, 2009 9:49 pm

Re: Could not connect to the database.Connector returned num

Post by Obievil » Mon Feb 27, 2012 5:25 pm

mitchell65 wrote:I would recommend that you go back to the developer and ask him to download Akeeba and make a backup of the site. This will backup all of the site details and the database. This will come as JPA compressed files/s. The number of files will depend on the size of the site, it may well be only one file. Have him send you that file/s and then you can FTP that file/s to your server, download the Kickstart applet from Akeeba and use that to install the site on your server. You will probably need to create a database on your server and it is VERY important to copy and paste the Server name, the user name, the password and the Database name very, very carefully. One very small mistake in any of these will attract the "Unable to connect to database error No2".
Come back here for any further help you may need.
the original host was unwilling. I ended up pinging a friend of mine who's a linux guru/geek/OCD. and we spent about 4 hours manually changing and updating every detail, and it works now. I did download and install Akeeba. but the backup is failing because of some obscure sql issue. still working on that.

jean_genie
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 28, 2012 6:18 pm

Re: Could not connect to the database.Connector returned num

Post by jean_genie » Tue Feb 28, 2012 6:25 pm

Hi,

I've read all the replies so far and have done them as well, and have read joomla guru's response and tried that step by step, however i am still having the same problem with the connector 2 error message coming up.

Is there anything else i can do?

1) i have given the database other names than "joomla"

2) i have given the user name as root and done it with out the word root

3) i have added a password and left the password feild blank

after all this, it still doesnt work, so please, can anyone help?

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Tue Feb 28, 2012 6:42 pm

You don't say whether this is on a localserver or a host. If it is a locaserver have you followed my Guide in the Signature below. The massage you are getting invariably means wrong details being entered in the database config screen. If you are following the Guide why did you create a password, this nees to be left blank? Where did you create it in the PHPAdmin or did you just enter a password on the Config screen?

jean_genie
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 28, 2012 6:18 pm

Re: Could not connect to the database.Connector returned num

Post by jean_genie » Tue Feb 28, 2012 6:48 pm

i didnt create a password and followed your guide step by step, i have tried everything, its a local server, xamp, also tried installing older versions of xamps, as well as older versions of joomla, constantly same error message.

mitchell65
Joomla! Ace
Joomla! Ace
Posts: 1614
Joined: Mon May 23, 2011 12:28 pm
Location: Cornwall

Re: Could not connect to the database.Connector returned num

Post by mitchell65 » Tue Feb 28, 2012 7:03 pm

Then why say "3) i have added a password and left the password feild blank"
Please go back and use the settings exactly as in the Guide. Also the Guide recommends Wamp and you are using Xamp! One of the version so Xamp is known to have problems with |Joomla, that's why I suggest using Wamp but if you make another choice that's up to you!

jean_genie
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 28, 2012 6:18 pm

Re: Could not connect to the database.Connector returned num

Post by jean_genie » Wed Feb 29, 2012 1:12 am

@mitchell - i didnt create a password and i tried with a password and followed your guide step by step, i have tried everything, its a local server, xamp, also tried installing older versions of xamps, as well as older versions of joomla, constantly same error message.

I have just noticed, i am not the only one using xamp, Chaz2000 is also using xamp. So i should just be using wamp then?

Ok, will try that, i used xamp on 1.7 and it was fine, i didnt reliase it was a one click install to 2.5, so i installed 2.5 manually, and then the problems came........


Locked

Return to “Installation Joomla! 2.5”