MDEV-25878: mytop bugs: check for mysql driver and sockets
mytop fall-back to DBD::mysql if DBD::MariaDB is not available Apply #1546
This commit is contained in:
parent
c3a1ba0fd9
commit
59e3ac2e67
@ -242,7 +242,11 @@ my $dsn;
|
|||||||
|
|
||||||
## Socket takes precedence.
|
## Socket takes precedence.
|
||||||
|
|
||||||
$dsn ="DBI:MariaDB:database=$config{db};mariadb_read_default_group=mytop;";
|
if (eval {DBI->install_driver("MariaDB")}) {
|
||||||
|
$dsn = "DBI:MariaDB:database=$config{db};mariadb_read_default_group=mytop;";
|
||||||
|
} else {
|
||||||
|
$dsn = "DBI:mysql:database=$config{db};mysql_read_default_group=mytop;";
|
||||||
|
}
|
||||||
|
|
||||||
if ($config{socket} and -S $config{socket})
|
if ($config{socket} and -S $config{socket})
|
||||||
{
|
{
|
||||||
@ -2095,7 +2099,7 @@ following:
|
|||||||
|
|
||||||
* Perl 5.005 or newer
|
* Perl 5.005 or newer
|
||||||
* Getopt::Long
|
* Getopt::Long
|
||||||
* DBI and DBD::MariaDB
|
* DBI and DBD::MariaDB or DBD::mysql
|
||||||
* Term::ReadKey from CPAN
|
* Term::ReadKey from CPAN
|
||||||
|
|
||||||
Most systems are likely to have all of those installed--except for
|
Most systems are likely to have all of those installed--except for
|
||||||
|
Loading…
x
Reference in New Issue
Block a user