DBIx::Connect::MySQL - Connect to DBI (mysql), search user/password from .my.cnf
This document describes version 0.002 of DBIx::Connect::MySQL (from Perl distribution DBIx-Connect-MySQL), released on 2017-08-16.
Instead of:
use DBI; my $dbh = DBI->connect("dbi:mysql:database=mydb", "someuser", "somepass");
you can now do:
use DBIx::Connect::MySQL; my $dbh = DBIx::Connect::MySQL->connect("dbi:mysql:database=mydb", undef, undef);
and user/password will be searched in ~/.my.cnf if unset.
This is a small wrapper for DBI->connect because the client library does not automatically search for user/password from .my.cnf files like in PostgresSQL.
DBI->connect
Will pass arguments to DBI->connect after setting the default of $user and $pass from ~/.my.cnf if possible.
$user
$pass
Please visit the project's homepage at https://metacpan.org/release/DBIx-Connect-MySQL.
Source repository is at https://github.com/perlancar/perl-DBIx-Connect-MySQL.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=DBIx-Connect-MySQL
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2017 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DBIx::Connect::MySQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Connect::MySQL
CPAN shell
perl -MCPAN -e shell install DBIx::Connect::MySQL
For more information on module installation, please visit the detailed CPAN module installation guide.