Support

Akeeba Backup for Joomla!

#40195 WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
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

Joomla! version
4.4.2
PHP version
8.1
Akeeba Backup version
9.8.4

Latest post by nicholas on Friday, 26 January 2024 02:11 CST

bealsbits

I get this error message everyday:

WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

 

 

nicholas
Akeeba Staff
Manager

I am not sure in what context you get this message, but it does not come from Akeeba Backup since we're not using this flag. As far as I can see, neither does Joomla itself. It looks like this is coming from something third party.

Of course any further context would greatly help figure out what you mean. You get it daily doing what? Where? What is the file and line mentioned in the message? Have you tried turning debug site on? Does that change the message? If so, what does it say? Giving me a random warning from something we don't use in our code does not help me help you.

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!

bealsbits

I get the message daily from the CRON Daemon:

 

 

(Cron Daemon) <[email protected]>
1:12 AM (9 hours ago)     cleardot.gif cleardot.gif
to me cleardot.gif
            WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Taking a backup with Akeeba Backup
==================================

Starting backup using profile #1.
---------------------------------

Last Tick   : 2024-01-24 07:10:04 GMT+0000 (UTC)
Domain      : init
Step        :
Substep     :
Progress    : 0.00%
Memory used : 19.78 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:04 GMT+0000 (UTC)
Domain      : installer
Step        :
Substep     :
Progress    : 0.00%
Memory used : 19.83 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:05 GMT+0000 (UTC)
Domain      : installer
Step        :
Substep     :
Progress    : 25.00%
Memory used : 19.83 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:05 GMT+0000 (UTC)
Domain      : PackDB
Step        :
Substep     :
Progress    : 25.00%
Memory used : 19.87 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:07 GMT+0000 (UTC)
Domain      : PackDB
Step        :
Substep     :
Progress    : 25.00%
Memory used : 20.69 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:07 GMT+0000 (UTC)
Domain      : Packing
Step        :
Substep     :
Progress    : 50.00%
Memory used : 20.74 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:22 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/templates/comp1/css
Substep     :
Progress    : 74.00%
Memory used : 20.78 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:37 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/images
Substep     :
Progress    : 74.00%
Memory used : 20.79 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:10:53 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/images/Background Video
Substep     :
Progress    : 74.00%
Memory used : 20.77 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:11:08 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/media/com_maximenuck/presets/horizontal/effect4
Substep     :
Progress    : 73.00%
Memory used : 20.8 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:11:24 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/media/vendor/mediaelement/js
Substep     :
Progress    : 74.00%
Memory used : 20.79 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:11:34 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/administrator/language/en-GB
Substep     :
Progress    : 74.00%
Memory used : 20.78 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:11:50 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/administrator/components/com_maximenuck/interfaces
Substep     :
Progress    : 74.00%
Memory used : 20.79 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:12:06 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/administrator/components/com_templateck/images
Substep     :
Progress    : 74.00%
Memory used : 20.79 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:12:17 GMT+0000 (UTC)
Domain      : Packing
Step        : /home/bealsbit/public_html/home/administrator/help/en-GB
Substep     :
Progress    : 75.00%
Memory used : 20.77 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:12:17 GMT+0000 (UTC)
Domain      : finale
Step        :
Substep     :
Progress    : 75.00%
Memory used : 20.8 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:12:25 GMT+0000 (UTC)
Domain      : finale
Step        :
Substep     :
Progress    : 100.00%
Memory used : 24.54 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:12:29 GMT+0000 (UTC)
Domain      : finale
Step        :
Substep     :
Progress    : 100.00%
Memory used : 24.53 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

Continuing the backup
---------------------

Last Tick   : 2024-01-24 07:12:29 GMT+0000 (UTC)
Domain      : finale
Step        :
Substep     :
Progress    : 100.00%
Memory used : 24.15 MB
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

 // Peak memory used : 26.18 MB                                                 

 // Backup loop exited after 2 minutes                                         

 [OK] The backup process is now complete.                                         

     

 

 

nicholas
Akeeba Staff
Manager

Ah! Now it makes far more sense. It is a PHP bug. The position of that message and the capitalisation of "WARNING" told me a lot about what is going on, I'm not even kidding. Warnings coming from code written in the PHP language use a lowercase spelling ("Warning:") and mention a file and line number. This laconic error message actually comes from libmysqlclient, a PHP dependency.

OK, let's take it one step at a time.

We need to know if the database connection is established, or if it needs to be re-established. To do that, we call PHP's mysql_ping() function. 

Since your global PHP configuration option mysqli.reconnect is enabled – something we have no control over – the PHP MySQL driver (mysqli) sends an instruction to the MySQL C++ connection library (libmysqlclient) with the flag MYSQL_OPT_RECONNECT. This flag is deprecated on MySQL 8 which is why a warning is printed.

Again, the problem is inside PHP itself, not our code. Again, the trigger for that is inside the PHP configuration itself which only your host and you can modify, not us.

One solution for this is to use PDO MySQL instead of mysqli in your site's Global Configuration. This is a more modern, more stable driver. It will stop PHP from causing this problem because PDO does not have an equivalent for mysql_ping(). Instead, we just run a simple SQL statement (SELECT 1) and check whether the server fails to execute it. 

Another solution is to contact your server and make sure that the global PHP configuration option mysqli.reconnect is disabled, and you don't have a php.ini, or .user.ini file which enables it. If it's already disabled, then the problem you have is that maybe PHP 8.1 has not been updated, though I have to say that on my own servers with mysqli.reconnect disabled I cannot reproduce the problem with the latest releases of PHP 7.4, 8.0, 8.1, 8.2, and 8.3.

If you would like more proof this does not come from our code, here's an example of this happening with Perl, a different programming language. Look at the comments in https://github.com/brianmario/mysql2/issues/1322 to see people saying that this is indeed the case with a large number of programming languages as well.

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!

bealsbits

Thank you! I have contacted my hosting service.

Does this error affect back/restore?

 

 

nicholas
Akeeba Staff
Manager

No, it does not affect anything.

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!