MySQL Forums
Forum List  »  Perl

WARNING: MYSQL_OPT_RECONNECT
Posted by: Alan Dunwell
Date: November 23, 2025 01:44PM

Howdy All,

Running Alma9
> mysql -V
mysql Ver 15.1 Distrib 10.5.29-MariaDB, for Linux (x86_64) using EditLine wrapper

I am NOT a mysql/mariadb guru

I have a perl script run via a cron job that takes data from a solar array every 10 minutes and plugs it into a mariadb database.
Starting ~ the first week of November there was an update/upgrade of Alma9 and there after the script, while still working fine and taking the data, started throwing and error message from the cron job that says

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

This was an old message and problem back in ~2023 but searching around I see nothing about it recently. Clearly it is just a warning, but I could find nothing about what is needed to be changed in my code. Given the info on the warning message I think it relates to how one makes the connection to the db. The relevant lines in my file where I make the connection are

---------------
use strict;
use warnings;
use DBI;
#use CGI;
use Device::SerialPort;
use lib '/usr/local/solar-web_monitor/cgi-bin';
use localvars;

my $db = DBI->connect ("DBI:mysql:$mysql_db:$mysql_host", $mysql_user, $mysql_passwd, {RaiseError => 1})>
#
-----------------

Any info as to how to change this, or where to look elsewhere in my code, so as to kill off the warning message is appreciated.

Options: ReplyQuote


Subject
Written By
Posted
WARNING: MYSQL_OPT_RECONNECT
November 23, 2025 01:44PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.