# Perl module DBD::mysql and MariaDB



## lucas1 (Sep 28, 2021)

Good afternoon.
Required install Perl module DBD::Mysql.
But already mariadb104-server installed.

Install  via cpan DBD::Mysql with error NOT OK
INSTALL via package p5-DBD-mysql requires  delete mariadb104-server and client.

DBD::Mysql needed because .\setup.sh a certain program is interrupted.
And recommendations developers:
Note : We highly recommend to use mariaDB


----------



## mark_j (Sep 28, 2021)

What port/package requires this?  If you build it from ports there's likely an option to use dbd::mariadb. Hell they'd be so close to functionally equivalent that I'd be tempted to use a link. Check that with cpan -c dbd::mysql

As an aside: Perl needs to get into the modern era and abstract this away. (Easier said than done though )


----------



## SirDice (Sep 28, 2021)

Set the default mysql version in /etc/make.conf: `DEFAULT_VERSIONS+=mysql=104m`. Then everything you build from ports which requires a MySQL client will be built with Mariadb 1.0.4 as a dependency.

Packages from the FreeBSD repositories will always be linked to MySQL 5.7 as that's the default MySQL version, see /usr/ports/Mk/bsd.default-versions.mk.


----------



## lucas1 (Sep 28, 2021)

Created /etc/make.conf, added the  parameter DEFAULT_VERSIONS+=mysql=104m.
The result is the same.


----------



## SirDice (Sep 28, 2021)

Build databases/p5-DBD-MySQL from ports, not that CPAN module you downloaded.


----------



## lucas1 (Sep 28, 2021)

```
/usr/ports/databases/p5-DBD-mysql# make install clean
===>  p5-DBD-mysql-4.048 Invalid perl5 version 5.32.
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/p5-DBD-mysql
```


----------



## SirDice (Sep 28, 2021)

The default Perl version is 5.32: `PERL5_DEFAULT?=		5.32`. What version of Perl do you have installed?


----------



## lucas1 (Sep 28, 2021)

usr/ports/databases/p5-DBD-mysql# make install clean
===>  p5-DBD-mysql-4.048 Invalid perl5 version 5.32.
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/p5-DBD-mysql
/usr/ports/databases/p5-DBD-mysql# perl --version

This is perl 5, version 32, subversion 1 (v5.32.1) built for amd64-freebsd-thread-multi

/etc/make.conf:

DEFAULT_VERSIONS+=mysql=104m
PERL5_DEFAULT?=   5.32


----------



## SirDice (Sep 28, 2021)

Don't put that in your /etc/make.conf please. It was an excerpt from /usr/ports/Mk/bsd.default-versions.mk to show what the current default version was.

How old is your ports tree? Have you updated that recently?


----------



## lucas1 (Sep 29, 2021)

Yes, I did not update the ports.
I will update.


----------



## lucas1 (Oct 4, 2021)

Yes,
after updating ports module perl p5-DBD-mysql installed successfully.
Thanks.

How to view the list of installed modules Perl?


----------



## SirDice (Oct 4, 2021)

lucas1 said:


> How to view the list of installed modules Perl?


If you installed them with ports/packages they'll all have a p5- prefix; `pkg info -x p5-`


----------

