Page 1 of 1

Database connection failed

Posted: Mon Apr 01, 2013 3:31 pm
by Estranghero
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 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!

Re: Database connection failed

Posted: Mon Apr 01, 2013 5:01 pm
by Per Yngve Berg
Have you exported and imported the database tables into the database on the new host? ... emote_host

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

Re: Database connection failed

Posted: Mon Apr 01, 2013 6:31 pm
by Estranghero
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 .... ?

Re: Database connection failed

Posted: Mon Apr 01, 2013 7:06 pm
by Per Yngve Berg
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.

Re: Database connection failed

Posted: Tue Apr 02, 2013 11:09 am
by Estranghero
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.

Re: Database connection failed

Posted: Wed Jun 12, 2013 5:32 pm
by klipper

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

Re: Database connection failed

Posted: Thu Jun 13, 2013 12:04 pm
by Estranghero
I´m sorry to say, but there was no solution at all! So I just rebuilt the site again.

Re: Database connection failed

Posted: Thu Jun 13, 2013 2:38 pm
by klipper
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.

Re: Database connection failed

Posted: Wed Oct 15, 2014 11:29 pm
by mods135
I had the same problem as klipper using Akeeba Kickstart.
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! :'(