Support

Site Restoration

#38389 Wrong database connection information

Posted in ‘Site restoration’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
7.4
CMS Type
Joomla!
CMS Version
n/a
Backup Tool Version
n/a
Kickstart version
7.1.2

Latest post by nicholas on Monday, 23 January 2023 08:16 CST

marvays

Hi.
I received a backup of his existing joomla site from a new client. I want to install it on my hosting. And I keep getting an error message about connecting to the database. What else can it cause? I tried all the classic methods. I have unpacked the website backup many times on my hosting. I've tried this 10 times and it doesn't want to connect. I tried creating a new database. A new user. New password. nothing. nothing.

I'm already desperate.

I can easily provide a login and you can try it out :)

 

 

Debug information

Cannot connect to the database: one or more of the database host name, user name and password you have provided is incorrect.

disk_1/www/com/domain/jm/installation/framework/database/restore/mysqli.php:84

 

#0 /disk_1/www/com/domain/jm/installation/framework/database/restore/mysqli.php(46): ADatabaseRestoreMysqli->getDatabase()
#1 /disk_1/www/com/domain/jm/installation/framework/database/restore.php(294): ADatabaseRestoreMysqli->__construct('site.sql', Array, Object(AContainer))
#2 /disk_1/www/com/domain/jm/installation/angie/controllers/dbrestore.php(94): ADatabaseRestore::getInstance('site.sql', Array, Object(AContainer))
#3 /disk_1/www/com/domain/jm/installation/framework/controller/controller.php(510): AngieControllerDbrestore->step()
#4 /disk_1/www/com/domain/jm/installation/framework/dispatcher/dispatcher.php(263): AController->execute('step')
#5 /disk_1/www/com/domain/jm/installation/framework/application/application.php(176): ADispatcher->dispatch()
#6 /disk_1/www/com/domain/jm/installation/index.php(129): AApplication->dispatch()
#7 /disk_1/www/com/domain/jm/installation/index.php(244): mainLoop()
#8 {main}

nicholas
Akeeba Staff
Manager

This error comes from the database server and it tells you that the combination of the database host name, database name, username, and password cannot be used to connect to your database server and selected database.

Check your database host name. It's not always localhost. Some hosts use an IP address (e.g. 1.2.3.4) others use a full domain name (i.e. mysql.myhost.com). If in doubt, please ask your host.

Remember that 127.0.0.1 and localhost mean different things when used as a database host name. Using 127.0.0.1 instructs PHP to use TCP/IP networking, localhost instructs PHP to use a named pipe. Most servers only support one method, but not the other. We cannot possibly know or detect that; you need to ask your host and provide the correct database host name.

Check your database name. Most hosts prefix the database name with your account name. For example, if your user account name on the host's server is "foo" and you try to create a database named "bar" the real database name is "foo_bar", not just "bar"! Do note that this prefix has nothing to do with the table name prefix (e.g. a2j5_) used by Joomla!. If in doubt, ask your host.

Check your username. The same principles with the database name apply, i.e. those hosts will prefix the database username with your account's name, e.g. myuser_mydatabase. If in doubt, ask your host.

Check your password. Many servers will not work with password which contain special characters (e.g. at sign, hash, dollar sign, percent sign, caret, ampersand, start, parentheses, equals sign, etc). The best approach is to make sure that your password consists only of alphanumeric characters, i.e. a-z, A-Z and 0-9, don't use any accented characters or characters with diacritic marks. This is not a limitation with our software, it's a limitation coming from the security configuration of many web servers which will block a request if your database password contains special characters like a hash sign, dollar sign, percent sign, caret and star.

Finally, do note that on most hosts creating a database and user is not sufficient to connect to your database. You also have to add the user to the database. Otherwise your server doesn't know that the username you are using should be able to access your database. This is an often overlooked step. cPanel, in particular, makes it very hard to understand that this is necessary by placing the interface to link databases to database users at the bottom of the page, below the fold even on fairly large displays (in my experience, up to 24").

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

marvays

You won't believe it, but I have checked all this several times.
I'll try writing to the webhosting support... it looks more like a problem on their end.

Thank you for your time. I'll let you know when I get it sorted.

marvays

Interesting... I took a backup of another site. Uploaded it to the same hosting in a secondary subdirectory. I used the same database, the same login and the website installed without any problems. is it possible that something in the akeeba backup file may be causing this?

nicholas
Akeeba Staff
Manager

Nope.

The database driver has not changed since 2018 and the database information page has not changed since 2020.

I've also done 5 site restorations just today, 2 of which are Joomla (4.2 and 3.10) sites.

Finally, if this page inadvertently ever breaks we will know within hours as nobody will be able to restore their sites. When the restoration script was missing some files due to a burp of the packaging script last week, making it impossible to run the restoration script at all, we knew within 3 hours and published a fixed version by the end of the day. That's the mixed blessing of having an active installed user base in the hundreds of thousands of sites :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

marvays

I have no doubts about Akeeba's qualities. I thought otherwise. if the backup file itself may be corrupted and affect the recovery process. I can't explain it otherwise. another connects to the database. not this one.

nicholas
Akeeba Staff
Manager

Which version of Akeeba Backup was it taken with? You can see that in the first page of the installation script.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!