Skip to content

Commit f3212eb

Browse files
committed
Document that connect needs undef password to read it from a config
In DBD::mysql, empty password works, too, but it means you can't pass an empty password, although it's a valid one.
1 parent cd4d05c commit f3212eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/DBD/MariaDB.pod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ config file, as in
217217
my $dsn = 'DBI:MariaDB:test;mariadb_read_default_file=/home/joe/my.cnf';
218218
my $dbh = DBI->connect($dsn, $user, $password);
219219

220+
If the config file specifies the password, you need to use C<undef> in
221+
C<connect>, not just an empty string, to have it replaced by the config value.
222+
All other attributes replace even the empty string.
223+
220224
The option I<mariadb_read_default_group> can be used to specify the default
221225
group in the config file: Usually this is the C<client> group, but see the
222226
following example:

0 commit comments

Comments
 (0)