perl5-dbi / DBD-MariaDB

Perl MariaDB driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DBD::MariaDB does not exist on cpan

7stud opened this issue · comments

commented

The links on the README page to DBD::MariaDB are broken, and cpan is not aware of any module named DBD::MariaDB.

commented

Yes, module is not on cpan yet. We would upload it to cpan after we declare it is stable, production ready and has final stable (documented) API.

commented

Okay, I thought something was wrong because the links on the README page go to meta-cpan, etc., and do not lead to DBD::MariaDB. On the other hand, I can report that DBD::MariaDB worked for me when DBD::mysql caused an error. I discovered that capitalization is important when using DBD::MariaDB:

use DBI;

my $db = 'mydb';
my $user = 'root';
my $pword = '';
my $host = 'localhost';

my $dsn = "dbi:MariaDB:database=$db;host=$host";
my $dbh = DBI->connect($dsn, $user, $pword);

After unzipping DBD-MariaDB-master.zip, I did a standard install from source:

$ cd DBD-MariaDB-master
$ perl Makefile.PL 
$ make
$ make test
$ make install

My info:

  1. OSX 10.13.2
  2. Perl 5.20.2
  3. I installed MariaDB with homebrew because I got errors trying to install from source. MariaDB is located here: /usr/local/Cellar/mariadb/10.2.12/
  4. I use perlbrew, and to install modules I do: $ cpan DBD::mysql.

Here is the error I got when I tried to install DBD::mysql:

...
...
Test Summary Report
-------------------
t/40server_prepare.t                  (Wstat: 256 Tests: 31 Failed: 1)
  Failed test:  27
  Non-zero exit status: 1
t/40server_prepare_crash.t            (Wstat: 11 Tests: 3 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 39 tests but ran 3.
t/40server_prepare_error.t            (Wstat: 512 Tests: 3 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
Files=69, Tests=2041, 34 wallclock secs ( 0.52 usr  0.17 sys +  3.90 c
+usr  0.77 csys =  5.36 CPU)
Result: FAIL
Failed 3/69 test programs. 3/2041 subtests failed.
make: *** [test_dynamic] Error 255
  MICHIELB/DBD-mysql-4.043.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, t
+ry:
  reports MICHIELB/DBD-mysql-4.043.tar.gz

$

Here is some info about my MariaDB install:

$ brew info mariadb
mariadb: stable 10.2.12 (bottled), devel 10.3.4
Drop-in replacement for MySQL
https://mariadb.org/
Conflicts with:
  mariadb-connector-c (because both install plugins)
  mysql (because mariadb, mysql, and percona install the same binaries
+.)
  mysql-cluster (because mariadb, mysql, and percona install the same 
+binaries.)
  mysql-connector-c (because both install MySQL client libraries)
  mytop (because both install `mytop` binaries)
  percona-server (because mariadb, mysql, and percona install the same
+ binaries.)
/usr/local/Cellar/mariadb/10.2.12 (640 files, 170MB) *
  Poured from bottle on 2018-01-27 at 00:05:02
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ma
+riadb.rb
==> Dependencies
Build: cmake ✘
Required: openssl ✔
==> Options
--with-archive-storage-engine
    Compile with the ARCHIVE storage engine enabled
--with-bench
    Keep benchmark app when installing
--with-blackhole-storage-engine
    Compile with the BLACKHOLE storage engine enabled
--with-embedded
    Build the embedded server
--with-libedit
    Compile with editline wrapper instead of readline
--with-local-infile
    Build with local infile loading support
--with-test
    Keep test when installing
--devel
    Install development version 10.3.4
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-bui
+lt
server starting up correctly.

MySQL is configured to only allow connections from localhost by defaul
+t

To connect:
    mysql -uroot

To have launchd start mariadb now and restart at login:
  brew services start mariadb
Or, if you don't want/need a background service you can just run:
  mysql.server start

$
commented

Okay, I thought something was wrong because the links on the README page go to meta-cpan, etc., and do not lead to DBD::MariaDB.

If you look into source of README.pod file you can see that there is no metacpan link. It is just standard POD format and github POD formatter generate links to metacpan -- not into own git repository.

But this is not a problem as module would be on cpan.

On the other hand, I can report that DBD::MariaDB worked for me when DBD::mysql caused an error.

That is expected :-) DBD::MariaDB was created just to fix errors as for DBD::mysql it is hard/impossible.

commented

Waiting for it ! Please 🙇

commented

Beta version 0.90_01 was released on CPAN!
https://metacpan.org/release/PALI/DBD-MariaDB-0.90_01