Skip to content

Commit

Permalink
Document that connect needs undef password to read it from a config
Browse files Browse the repository at this point in the history
In DBD::mysql, empty password works, too, but it means you can't pass
an empty password, although it's a valid one.
  • Loading branch information
choroba committed Jun 30, 2024
1 parent cd4d05c commit f3212eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/DBD/MariaDB.pod
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ config file, as in
my $dsn = 'DBI:MariaDB:test;mariadb_read_default_file=/home/joe/my.cnf';
my $dbh = DBI->connect($dsn, $user, $password);

If the config file specifies the password, you need to use C<undef> in
C<connect>, not just an empty string, to have it replaced by the config value.
All other attributes replace even the empty string.

The option I<mariadb_read_default_group> can be used to specify the default
group in the config file: Usually this is the C<client> group, but see the
following example:
Expand Down

0 comments on commit f3212eb

Please sign in to comment.