Wise Monks,
I am migrating from MySQL to MariaDB and my usual Perl DBD dsn which reads credentials from file (instead of storing/hardcoding then in perl code) fails.
Previously, with MySQL, the connection drill was something like:
my $dsn = 'DBI:mysql:database=testdb;mysql_read_default_file=creds.txt +'; my @dsns = ( $dsn, '', # username is read from file '', # password is read from file {"RaiseError" => 1, "PrintError" => 1} ); my $dbh = eval { DBI->connect(@dsns) }; die $@ if $@;
Where the credentials file creds.txt reads like this:
[client] user=testuser password=apass
Above code is equivalent to running mysql client on the command line like mysql --defaults-extra-file="creds.txt". This command logs me in the DB fine from the CLI.
Now, modifying the dsn a bit for DBD::MariaDB:
my $dsn = 'DBI:MariaDB:database=testdb;mariadb_read_default_file=creds +.txt'; ...
Fails with failed: Access denied for user 'testuser'@'localhost' (using password: NO). Notice that it reads the username (testuser) correctly from the file. But ignores(?) the password. But using the CLI interface it logs me in fine (reads both username and password).
It is also weird that if I give it a fake file in the dsn above, it does not say (using password: NO). And the username is my login name. All these make me think that all works fine except from reading the password. Any hints?
thank you // bw, bliako
In reply to MariaDB : read credentials from file fails (via dsn option mariadb_read_default_file) by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |