Apache and mod_authn_dbd DBDPrepareSQL error
Posted
by
David Brown
on Server Fault
See other posts from Server Fault
or by David Brown
Published on 2012-06-15T14:24:02Z
Indexed on
2012/06/15
15:18 UTC
Read the original article
Hit count: 571
I am running Apache 2.2.17 on Suse Linux 11. I have installed the mod_authn_dbd module to allow authentication using a MySQL database. Simple digest authentication works absolutely fine using the following directive:
AuthDBDUserRealmQuery "SELECT loginPassword FROM login WHERE loginUser = %s and loginRealm = %s"
However, I would like to both generalize this statement and prepare it for performance and security reasons. Thus, I used the following directives instead:
DBDPrepareSQL "SELECT loginPassword FROM login WHERE loginUser = %s and loginRealm = %s" digestLogin
AuthDBDUserRealmQuery digestLogin
These directives generate the following errors:
[...] [error] (20014)Internal error: DBD: failed to prepare SQL statements:
[...] [error] (20014)Internal error: DBD: failed to initialise
Why does my actual SQL statement work when used directly, but not when I try to prepare it?
(Note I have tried using '?' and '%%' in place of '%', to no effect.)
© Server Fault or respective owner