Reputation: 11
I created this Perl script to update a bunch of CMS installations automatically. It has worked for years. Now it is failing when attempting to connect to each of the databases. This occurred after updating all of the databases from MySQL 5.7 to MariaDB 10.3. The line it fails on is pretty basic:
$dbh = DBI->connect($db_str, $user_str, $pass_str);
The $db_str is constructed in this line:
$db_str = "DBI:mysql:" . $database . ":localhost";
If figure it has to be one of two things: Either the connection string needs to be different for MariaDB, or there is a missing Perl library for MariaDB. But I am new to MariaDB, so I do not know.
Upvotes: 0
Views: 509
Reputation: 11
Found the problem: The path to the Perl libs at the top of the script has changed. This:
#!/usr/bin/perl
needed to be changed to:
#!/usr/local/cpanel/3rdparty/bin/perl
It was specific to the setup of the server which may have changed during an update. Thanks!
Upvotes: 1