Support

Site Restoration

#34335 Kickstart cannot connect to mysq:l Unable to connect to the Database: Could not connect to MySQL.

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
n/a
CMS Type
Other
CMS Version
n/a
Backup Tool Version
n/a
Kickstart version
n/a

Latest post by on Thursday, 11 February 2021 20:17 CST

Aido21

Hi.. i downgrade my mysql to 5.6 from 8.0 for some reasons

and now kickstart cannot get access to the database

The database exists and the name and the password are correct - i can connect with them via console but alway get error in the kickstart...

 

nicholas
Akeeba Staff
Manager

Please note that Kickstart only extracts the backup archive, it DOES NOT restore the database. The database restoration takes place through the restoration script (ANGIE) which is included in the backup archive at backup time. You can confirm that by looking at the top of the page when you are entering the database information. The name of the script is written in large type. This information is also printed every time you run Kickstart.

Regarding the database issue, first please try following the instructions on https://www.akeeba.com/documentation/akeeba-backup-documentation/abidatabase.html

Moreover, do note that we no longer support PHP 5.6. If your server's default PHP version is 5.6 you have two alternatives:

  • Ask your host to change the default PHP version to 7.2 or later, ideally 7.4, for your web hosting account.
  • BEFORE running Kickstart go to your hosting control panel and change the PHP version to 7.4. The timing is crucial. The PHP version is applied by your host creating or changing your site's .htaccess file. Kickstart will pick up this change and carry it forward throughout the restoration — but only if the .htaccess file with the instruction to change the default PHP version is present before it starts extracting the backup archive.

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!

Aido21

1. I have php 7.4 on my server. 5.6 is a mysql version

2. Ok it is clear about kickstart and ANGIE :-) 

I m confused why do i have a correct  access via cli but ANGIE script does not have. I will try you manual. I hope it helps.

Aido21

Thanks that manual is very clear but it has not helped.

I have the database on my server, and connected user with password and i can connect and use this database via ssh.

But the installation script cannot connect... may be must me any settings on server that make available php connections. I am not so good with it.

BDW Where could i find any logs to look at that error more detailed?

Aido21

I did a simple test - mysqli_connect returns
errno: 2002
error: No such file or directory

So it is not a akeeba issue

I think I’ve broken the mysql config but cannot understand where :-)

nicholas
Akeeba Staff
Manager

OK, when you said 5.6 I misunderstood. MySQL 5.6 should work just fine, at least to the degree that any software installed in the site you backed up doesn't use any MySQL 5.7 or 8.0 features. It would definitely have no impact over the connection to the database.

The database connection code using in ANGIE is actually the same code used in Joomla itself. So it's not an Akeeba Backup issue or your site itself would not have been able to connect which means that you wouldn't have been able to back it up. Your test was correct.

If you search the MySQL error code (2002) you will see that it means that MySQL cannot connect through a socket file. Instead of using localhost use 127.0.0.1 for the database server hostname. There is a massive difference between the two in the context of connecting to a MySQL server as you can read in the page I linked you. localhost means that you want MySQL to connect with a socket file, 127.0.0.1 means that you want to connect through TCP/IP.

If this doesn't help it would mean that you have disabled TCP/IP networking in your my.cnf file and that you have either disabled socket connections or your socket file does not have adequate access permissions for other processes to connect to it. A final possibility is that you installed the MySQL client package but not the MySQL server package — I've made that mistake myself but at least I knew how to correctly check with aptitude what the heck I've installed :p

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!