Database connection failed

Discussion regarding Joomla! 2.5 Performance issues.

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.
Locked
Estranghero
Joomla! Explorer
Joomla! Explorer
Posts: 276
Joined: Thu May 14, 2009 7:05 am

Database connection failed

Post by Estranghero » Mon Apr 01, 2013 3:31 pm

Dear People,

yes I know, that issue might be very easy and quick to solve, but I still don't know how - while I'm still learning: Because of I'm forced to change my server, I downloaded all files from the previous one and uploaded to the new one. Additional I changed public $user,
public $password and the name of the public $db inside of the cofiguration.php. Now I'm wondering if during the data transfer to the other server the public $dbprefix changed as well, because when loading my site http://www.austrialandscapes.com/ the error message "Database connection error (2): Could not connect to MySQL" appears.
When that's the issue, where do I can find the new $dbprefix?
If not, whatelse do I need to change and where?
Please note, I'm not that good with DB - related topics.
If anyone knows the issue. please explain me, so dump as possible :-[ !

Thank you for all your support!

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 26021
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Database connection failed

Post by Per Yngve Berg » Mon Apr 01, 2013 5:01 pm

Have you exported and imported the database tables into the database on the new host?

http://docs.joomla.org/Copying_a_websit ... emote_host

You can install the Akeeba Backup extension to backup the site and move it with Kickstart from Akeeba.

Estranghero
Joomla! Explorer
Joomla! Explorer
Posts: 276
Joined: Thu May 14, 2009 7:05 am

Re: Database connection failed

Post by Estranghero » Mon Apr 01, 2013 6:31 pm

yes, I did import the tables as well! I know about Akkeba, but that backup doesn't work for me. So, it that mean, that I did everything I should, but .... ?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 26021
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Database connection failed

Post by Per Yngve Berg » Mon Apr 01, 2013 7:06 pm

Do the database user have a password set?
Can you connect to the database with phpmyadmin?
The db prefix will be the same, if you have not renamed the tables.

Estranghero
Joomla! Explorer
Joomla! Explorer
Posts: 276
Joined: Thu May 14, 2009 7:05 am

Re: Database connection failed

Post by Estranghero » Tue Apr 02, 2013 11:09 am

Yes, I did use the same password for the DB as for my host account, and yes I can connect to the database via phpmyAdmin. Now I tried the file transfer with Akeeba, as you suggested me at the very beginning. But there, when I try to restore I receive that error message:
SQL=CREATE DATABASE `austrial_austrialandscapes` CHARACTER SET `utf8`
I also checkmarked those options below, but I get the same error message :(!
- Suppress foreign key checks
- Use REPLACE instead of INSERT
- Force UTF-8 collation on database
- Force UTF-8 collation on tables
As an additional information, the new server is running under php 5.4, and the MySQL connection collation on phpMyAdmin is set to "utf8_general_ci" (MySQL charset: UTF-8 Unicode (utf8)
I'm using Kickstart core 3.6 on Akeeba Backup Core 3.7.4.
I also tried to submit a ticket by Akeeba, but got no feedback yet.

User avatar
klipper
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Nov 22, 2005 10:03 pm
Location: Netherlands

Re: Database connection failed

Post by klipper » Wed Jun 12, 2013 5:32 pm

@Estranghero

I have exact same database error during install of backup at new host.
I have not find solution for it. Installing the backup on my localhost works flawless.

Do you think this is a database connection issue?

So my question to you: Have you found a solution for this? If yes can you please post here your solution?

Thanks in advance

Estranghero
Joomla! Explorer
Joomla! Explorer
Posts: 276
Joined: Thu May 14, 2009 7:05 am

Re: Database connection failed

Post by Estranghero » Thu Jun 13, 2013 12:04 pm

I´m sorry to say, but there was no solution at all! So I just rebuilt the site again.

User avatar
klipper
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Nov 22, 2005 10:03 pm
Location: Netherlands

Re: Database connection failed

Post by klipper » Thu Jun 13, 2013 2:38 pm

Hi Estranghero,

I finally found the solution. It was a quit stupid issue. I over-viewed when creating the MySQL database en MySQL user in the cPanel form of my provider. The problem was that I thought that the database User was connected to the database, but it wasn't. During creation I missed last step to connect both. After connecting User and Database the whole issue was solved and database restoration worked flawless.
I found solution for it on the Akeeba website, where Nicolas pointed someone else with the same issue to this solution.

Sad for you that you had to rebuilt your site.

mods135
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Apr 26, 2012 4:30 am

Re: Database connection failed

Post by mods135 » Wed Oct 15, 2014 11:29 pm

I had the same problem as klipper using Akeeba Kickstart.
SQL=CREATE DATABASE `ide32070_xx` CHARACTER SET `utf8`
The same cause - not linking the user to the database. Creating the user does not automatically link it to the databases - seems dumb now. My unpack also failed as my server had only php 5.4 when the upload required php 5.5 so the front page would not open - just an error message.
Warnings for novices! :'(
You do not have the required permissions to view the files attached to this post.


Locked

Return to “Performance - Joomla! 2.5”