Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

DBD::MariaDB or DBD::Mysql

by Anonymous Monk
on Oct 14, 2018 at 08:32 UTC ( #1223996=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm confused.For accessing Mysql which driver do I use?

Replies are listed 'Best First'.
Re: DBD::MariaDB or DBD::Mysql
by haukex (Chancellor) on Oct 14, 2018 at 13:38 UTC

      Sounds like

      • DBD::MariaDB fixes SSL issues (which may or may not still be present in DBD::mysql)
      • DBD::MariaDB fixes issues with character encodings that can't be fixed in DBD::mysql without causing existing code to break.[1]

      1. Well, so that slides claim. It seems to me a flag to the constructor could also do the trick, but that might have led to very complex code.
Re: DBD::MariaDB or DBD::Mysql
by LanX (Archbishop) on Oct 14, 2018 at 09:29 UTC

      That's an over-simplistic and misleading answer. The above is a quote from the MariaDB website. But the OP is enquiring about MySQL. The MySQL website states:

      27.9 MySQL Perl API

      The Perl DBI module provides a generic interface for database access. You can write a DBI script that works with many different database engines without change. To use DBI with MySQL, install the following:

      The DBI module.

      The DBD::mysql module. This is the DataBase Driver (DBD) module for Perl.
      See https://dev.mysql.com/doc/refman/8.0/en/apis-perl.html

      Hope this helps!


      The way forward always starts with a minimal test.
        DBD::mysql is *a* database driver for MySQL and MariaDB, but it has many maintenance issues and bugs and fundamentally broken Perl string handling. DBD::MariaDB is a fork that still supports both databases and fixes these issues, and should be used for all new projects. The MySQL website of course doesn't mention it because it's new.
        > That's an over-simplistic and misleading answer. 

        Appropriate to an over-simplistic and misleading question? 

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Re: DBD::MariaDB or DBD::Mysql
by 1nickt (Abbot) on Oct 14, 2018 at 13:23 UTC

    Hi, that's a good question and I agree that it's confusing and not answered simply by quoting a blurb from the MariaDB website. The following is how I understand it as a 22-year user of Perl/MySQL for database development.

    MySQL began as an open-source RDBMS. Its holding company was sold to Sun Microsystems and then absorbed into Oracle, which comntinues to maintain and release a "community" open source version. DBD::mysql or a predecessor has been the open-source Perl DBI driver for MySQL since the early 1990s; in its current form since 1995.

    MariaDB was started as an open-source replacement for the now-commercially owned MySQL. Since its introduction many hard-working developers have tried to ensure that the two are as near-compatible as possible. DBD::mysql has been patched often to keep it compatible with the MariaDB client libraries as well as those for MySQL.

    In summer 2018 Pali forked DBD::mysql because it had accumulated a list of unresolved bugs and support requests. In July 2018 version 1.00 was released. Pali has also continued to contribute to DBD::mysql.

    Since that time, the MariaDB website has garnered the statement quoted by LanX above, and the doc for DBD::MariaDB boldy says: "DBD::MariaDB is the Perl5 Database Interface driver for MariaDB and MySQL databases" (emphasis mine). And while that doc in the Author section does acknowledge the long history of DBD::mysql development, it gives the impression that the fork was on an abandoned module and that DBD::MariaDB is now the only DBI solution for MySQL.

    This is patently not true. DBD::mysql continues in active development with regular releases. And in fact the MySQL website states: "The DBD::mysql module. This is the DataBase Driver (DBD) module for Perl" (emphasis mine).

    That hubristic "spin" is what has caused me personally to skip the fork for now. It may be a great way to access MySQL databases; it may even be more up-to-date in regards to edge use cases that I never encounter. But it's certainly not the only DBI accessor. (I'm also concerned about gradual drift towards MySQL-incompatibility since such support is obviously a poor stepsister to MariaDB).

    So yeah, it's confusing. As of today you can use either. I use DBD::mysql and plan to continue doing so.

    Hope this helps!


    The way forward always starts with a minimal test.
      > DBD::mysql is the Perl5 Database Interface driver for the MySQL database. In other words: DBD::mysql is an interface between the Perl programming language and the MySQL programming API that comes with the MySQL relational database management system

      (emphasis mine).

      seems like the author forked the documentation too.

      > it gives the impression that the fork was on an abandoned module

      Where exactly? All I found is:

      > In 2018 unreleased version 4.042_01 of DBD::mysql was forked and DBD::MariaDB was created to fix long standing Unicode bugs and MariaDB support. Currently it is developed in GoodData and maintained by Pali (pali@cpan.org).

      Looks like a company's fork to fix particular needs, much like with Cpanel and JSON.

      Compare Cpanel::JSON::XS

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      I wouldn't take the documentation so personally, especially since the particular parts you quoted are just copies of the DBD::mysql documentation. I would suggest getting more familiar with the history of the need for the fork, which I can summarize as: Many people over the years report the Unicode bug, the maintainers do nothing, Pali contributes a fix to the Unicode bug, it breaks existing code and is reverted along with a large amount of other important fixes, the maintainers continue to do nothing, Pali and GoodData fork the module, the maintainers start reapplying fixes to DBD::mysql that were previously reverted. Also, the name choice is unfortunate and I disagreed with it at the time but neither DBD::mysql nor DBD::MariaDB have shown any intention of only supporting one or the other so far.
        And feel free to look up the relevant mailing list threads yourself if you think my viewpoint is too biased, but please take note of the dates of posts and commits on the repo while bugs and broken behavior persisted.
      In summer 2018 Pali forked DBD::mysql because it had accumulated a list of unresolved bugs and support requests. In July 2018 version 1.00 was released. Pali has also continued to contribute to DBD::mysql.

      Some more history:

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1223996]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2019-08-25 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?