Mariadb

19 views
Skip to first unread message

jfrm

unread,
Jan 2, 2020, 1:43:50 PM1/2/20
to Rose::DB::Object
Some time on from my exploratory question regarding Rose and Mariadb, the same thing has arisen again. A colleague has advised that Mariadb should be "better" than MySQL (for upgrade path and replication at least) so we should move to it if possible.  But I don't want to do this unless I'm very confident that Rose will work because I don't want to stop using Rose::DB::Object, naturally.

A glance at Rose::DB 9 Aug, 2019 gives that Rose::DB currently supports the following DBI database drivers:

DBD::Pg       (PostgreSQL)
DBD::mysql    (MySQL)
DBD::SQLite   (SQLite)
DBD::Informix (Informix)
DBD::Oracle   (Oracle)
but Rose::DB will attempt to service an unsupported database using a generic implementation that may or may not work. Support for more drivers may be added in the future.

I understand that MariaDB is very similar to mysql and so the chances of it working should be reasonable.  But I'd like a bit more certainty(!)   
Is anyone out there using MariaDB with Rose?   Does anyone have any insight into just how risky it would be?

Given that there seems to be an open source push for MariaDB, is it likely that anyone more competent than myself will write an implementation for DBD::MariaDB before long?



Peter Karman

unread,
Jan 5, 2020, 11:28:33 AM1/5/20
to rose-db...@googlegroups.com
I was curious about this so I did some research.

Caveats:

* I don't use RDBO with MySQL or MariaDB currently, and last used it with MySQL in any production context 5 years ago.
* Versions change.
* MariaDB is a fork[0] and like all forks will tend to drift apart in terms of feature compatibility over time. What works today might not work tomorrow, etc.

The tl;dr is "yes Rose will support MariaDB".

The longer answer is, it depends on what you mean by MariaDB.

If you just want to use the existing Rose::DB::MySQL driver with DBD::mysql and point it at a MariaDB server, that works with no problem. I installed 10.4.10-MariaDB locally and ran the Rose::DB tests for t/mysql.t and they all passed. That's because DBD::mysql (the client driver) will connect to MariaDB server and Do The Right Thing.

If you want to use the DBD::MariaDB client driver itself, then Rose::DB doesn't know how to work with that (yet). You should read up on DBD::MariaDB if you haven't yet.


I gave myself 30 minutes and did some search/replace and made a Rose::DB::MariaDB driver:

and got all the tests passing.

I hope that answers the questions you asked.

Your next question will probably be "should I use DBD::MariaDB" and that is a harder question IMO. It comes down to support and maintenance. DBD::MariaDB seems to be where the community energy is moving. But if you're concerned with community energy, you're probably not using Rose these days either.

HTH,
pek

[0] You might argue that MySQL is a fork of MariaDB but that's a religious argument IMO.


--
Source: https://github.com/siracusa/rose
CPAN: http://search.cpan.org/dist/Rose-DB-Object
---
You received this message because you are subscribed to the Google Groups "Rose::DB::Object" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rose-db-objec...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rose-db-object/07c805b8-ccff-4ca5-8c0c-3b637a70e584%40googlegroups.com.


--
Peter Karman  .  he/him/his  .  https://karpet.github.io/

Darren Duncan

unread,
Jan 5, 2020, 9:36:24 PM1/5/20
to rose-db...@googlegroups.com
On 2020-01-05 8:28 a.m., Peter Karman wrote:
> But if you're concerned with
> community energy, you're probably not using Rose these days either.

What do you mean by that? Has the community decided that it is better to fully
exploit their DBMS by writing SQL rather than using ORMs to abstract that away?
I haven't been paying too close attention these days. -- Darren Duncan

jfrm

unread,
Jan 6, 2020, 11:07:08 AM1/6/20
to Rose::DB::Object


On Monday, 6 January 2020 02:36:24 UTC, (Darren Duncan) wrote:
On 2020-01-05 8:28 a.m., Peter Karman wrote:
> But if you're concerned with
> community energy, you're probably not using Rose these days either.

Yes, I'm interested to hear about that, too.  I think Rose is totally brilliant because it's so elegant and just works but I know that DBIx::Class is more popular these days.  
What does DBIx::Class have that Rose::DB::Object doesn't?

jfrm

unread,
Jan 6, 2020, 11:11:42 AM1/6/20
to Rose::DB::Object
And thanks for the helpful answer, Peter.  
FYI Another chap wrote to say that his organisation had done a replace of MySQL with MariaDB more than 4 years ago. Changed only the database and continued using the DBD::mysql driver. There have been zero problems.

John Siracusa

unread,
Jan 6, 2020, 11:51:02 AM1/6/20
to rose-db-object
Has anyone gotten DBD::MariaDB to compile on macOS Catalina? I'm trying and failing…

-John

Peter Karman

unread,
Jan 6, 2020, 1:06:16 PM1/6/20
to rose-db...@googlegroups.com
Yep, just installed for me on OS X 10.15.2 with perl 5.28.1

I just did

 % brew install mariadb
 % cpan DBD::MariaDB

with no problems.

What error do you get?

pek

John Siracusa

unread,
Jan 6, 2020, 1:14:15 PM1/6/20
to rose-db-object
I've got MariaDB installed and working. (I can connect from the command line, etc.)

The CPAN shell install falls. Manually, I can't get past the "perl Makefile.PL" step:
---

# perl Makefile.PL --testuser=test --mariadb_config=/usr/local/mariadb/server/bin/mariadb_config

I will use the following settings for compiling and testing:


  cflags       (mysql_config ) = -I/usr/local/mariadb/server/include/mysql -I/usr/local/mariadb/server/include/mysql/mysql

  libs         (mysql_config ) = -L/usr/local/mariadb/server/lib/ -lmariadb -lpthread -ldl -lm -liconv -l/usr/local/lib/libgnutls.a -l/usr/local/lib/libnettle.a -l/usr/local/lib/libtasn1.a -l/usr/local/lib/libgmp.a -l/usr/local/lib/libhogweed.a

  mysql_config (User's choice) = /usr/local/mariadb/server/bin/mariadb_config

  testdb       (default      ) = test

  testhost     (default      ) = 

  testpassword (default      ) = 

  testport     (default      ) = 

  testsocket   (default      ) = 

  testuser     (User's choice) = test


To change these settings, see 'perl Makefile.PL --help' and

'perldoc DBD::MariaDB::INSTALL'.


Checking if libs and header files are available for compiling...

Can't link/include C library '/usr/local/lib/libgnutls.a', '/usr/local/lib/libnettle.a', '/usr/local/lib/libtasn1.a', '/usr/local/lib/libgmp.a', '/usr/local/lib/libhogweed.a', aborting.

---


I've tried many variations of adding include and lib dirs (since the MariaDB stuff is all under /usr/local/mariadb/server) with no luck so far.


-John


Peter Karman

unread,
Jan 6, 2020, 1:33:44 PM1/6/20
to rose-db...@googlegroups.com
Can't link/include C library '/usr/local/lib/libgnutls.a', '/usr/local/lib/libnettle.a', '/usr/local/lib/libtasn1.a', '/usr/local/lib/libgmp.a', '/usr/local/lib/libhogweed.a', aborting.

Those smell like openssl (or the lack of it).

I wonder if because I'm using homebrew rather than manually compiled it included deps in more predictable places? I would have thought mariadb_config would spew the right stuff though.

Mine looks like:

I will use the following settings for compiling and testing:

  cflags       (mysql_config) = -I/usr/local/Cellar/mariadb/10.4.10_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.10_1/include/mysql/mysql
  libs         (mysql_config) = -L/usr/local/Cellar/mariadb/10.4.10_1/lib/ -lmariadb
  mysql_config (guessed     ) = mariadb_config

  testdb       (default     ) = test
  testhost     (default     ) =
  testpassword (default     ) =
  testport     (default     ) =
  testsocket   (default     ) =
  testuser     (guessed     ) = pkarman


To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::MariaDB::INSTALL'.

Checking if libs and header files are available for compiling...
Checking if correct version of MariaDB or MySQL client is present...
Looks good.

Peter Karman

unread,
Jan 6, 2020, 1:34:37 PM1/6/20
to rose-db...@googlegroups.com
And my mariadb_config output

$ mariadb_config
Copyright 2011-2019 MariaDB Corporation AB
Get compiler flags for using the MariaDB Connector/C.
Usage: mariadb_config [OPTIONS]
  --cflags        [-I/usr/local/Cellar/mariadb/10.4.10_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.10_1/include/mysql/mysql]
  --include       [-I/usr/local/Cellar/mariadb/10.4.10_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.10_1/include/mysql/mysql]
  --libs          [-L/usr/local/Cellar/mariadb/10.4.10_1/lib/ -lmariadb]
  --libs_r        [-L/usr/local/Cellar/mariadb/10.4.10_1/lib/ -lmariadb]
  --libs_sys      [-lz -liconv -lssl -lcrypto]
  --version       [10.4.10]
  --cc_version    [3.1.5]
  --socket        [/tmp/mysql.sock]
  --port          [3306]
  --plugindir     [/usr/local/Cellar/mariadb/10.4.10_1/lib/plugin]
  --tlsinfo       [OpenSSL 1.1.1d]

John Siracusa

unread,
Jan 6, 2020, 3:00:25 PM1/6/20
to rose-db-object
I eventually got it working with a few strategic symlinks. Rose::DB 0.780 incorporating Peter's MariaDB support was just uploaded to CPAN.

-John

John Siracusa

unread,
Jan 6, 2020, 3:49:43 PM1/6/20
to rose-db-object
…aaaand I messed up the MANIFEST file, so I just uploaded a corrected version 0.781.

-John

Peter Karman

unread,
Jan 6, 2020, 8:59:37 PM1/6/20
to rose-db...@googlegroups.com

Peter Karman

unread,
Jan 6, 2020, 8:59:57 PM1/6/20
to rose-db...@googlegroups.com

--
Source: https://github.com/siracusa/rose
CPAN: http://search.cpan.org/dist/Rose-DB-Object
---
You received this message because you are subscribed to the Google Groups "Rose::DB::Object" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rose-db-objec...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages