# p5-DBD-mysql vs p5-DBD-MariaDB



## dd_ff_bb (Oct 9, 2020)

I use mariadb104-server when i try to install p5-DBD-mysql from pkgs it requires mysql57-client which is understandable as FreeBSD still defaults to mysql57

So to use that module i changed /etc/make.conf to mariadb and build  databases/p5-DBD-mysql from ports; no problems, works like charm

Question is why does databases/p5-DBD-MariaDB pkg depends on databases/mysql57-client as well. 

One would assume (actually i did assumed!!!) since its a mariadb build, it would depend on databases/mariadb104-client

If i try to install databases/p5-DBD-MariaDB from pkgs it requires databases/mysql57-client and creates conflict tries to remove mariadb-client etc... 

Of course it becomes understandable once you check freeshports for databases/p5-DBD-MariaDB dependencies:

Library dependencies:

libmysqlclient.so.20 : databases/mysql57-client
But why would anybody build Mariadb perl module pkg with mysql57-client library dependency ?????


----------



## SirDice (Oct 9, 2020)

dd_ff_bb said:


> Question is why does databases/p5-DBD-MariaDB pkg depends on databases/mysql57-client as well.


Because it depends on whatever MySQL/MariaDB is set as default.


```
USES=                   compiler:c11 mysql perl5
```

See /usr/ports/Mk/Uses/mysql.mk.









						Chapter 17. Using USES Macros
					

USES macros make it easy to declare requirements and settings for a FreeBSD Port




					www.freebsd.org


----------



## dd_ff_bb (Oct 9, 2020)

So what is the purpose of having p5-DBD-MariaDB package if it also depends on mysql57-client


----------



## SirDice (Oct 9, 2020)

First line of the description:

```
DBD::MariaDB is the Perl5 Database Interface driver for MariaDB and MySQL databases.
```

Although it's named as MariaDB it's not for MariaDB alone. 






						DBD::MariaDB - metacpan.org
					

MariaDB and MySQL driver for the Perl5 Database Interface (DBI)




					metacpan.org


----------



## dd_ff_bb (Oct 9, 2020)

But this kind of uses option "USES=  compiler:c11 mysql perl5" makes it same as p5-DBD-mysql pkg because no matter what it falls back to default

And makes it impossible to use this pkg for mariadb database, so why even bother to create this pkg

Shouldn't it be used as 104m or some mariadb version.
After all this package is for mariadb users how many mysql users will be tempeted to install mariadb module and why?

Plus mysql and mariadb is getting less and less interchangeable (mysql 8 etc....)


----------



## SirDice (Oct 9, 2020)

Packages are _always_ built using the default options and versions. If you want/need to deviate from that you should build your own package repository.


----------



## tbyte (Apr 3, 2021)

SirDice said:


> Packages are _always_ built using the default options and versions. If you want/need to deviate from that you should build your own package repository.


Uhmmm what's the point of having 2 packages when they are the same then ? And why would p5-DBD-MariaDB use mysqlclient when its name means that it should be using  mariadbX-client ? That makes no sense at all.


----------



## Matlib (Apr 3, 2021)

DBD::MariaDB is simply a newer package forked from DBD::mysql in 2018 when its development stalled.

Considering the number of bug fixes at the bottom of that changelog, it's definitely worth trying out.


----------

