f



Apache2 + MySQL Authentication = MySQL Syntax Error

Hello All,
I am trying to setup Apache2 with MySQL Authentication. I can get it to
work fine if I do not use group based authentication, i.e.; only look
at the table for the user id and password. If I add the group
directives I cannot login (it just keeps  asking for the username and
password) and I get a MySQL syntax error in my http error log.

---------------------------------------
Here is my setup:

OS = Mandrake 10.1
Apache = 2.0.50-7.2.101mdk
MySQL Auth Mod = 2.0.50_1.11-3mdk
MySQL = 4.0.20-3.1.101mdk

Note that this was all installed via Mandrake RPMs.

---------------------------------------
Here is my httpd2.conf relevent to MySQL Auth:
** NOTE I have changed to MySQL DB, User /PW, and directory info for
security.

LoadModule mysql_auth_module    extramodules/mod_auth_mysql.so

<Directory /path/to/protected/directory>
AuthName "Apache / MySQL Auth"
AuthType Basic
AuthMySQLUser mysqluserid
AuthMySQLPassword mysqlpassword
AuthMySQLDB Database
AuthMySQLUserTable UserTable
AuthMySQLNameField user
AuthMySQLPasswordField password
AuthMySQLGroupTable GroupTable
AuthMySQLGroupField group
require group admin
</Directory>

----------------------------------------
Here is the error I get in http error log:

[Sun Dec 19 16:34:16 2004] [error] MySQL error You have an error in
your SQL syntax.  Check the manual that corresponds to your MySQL
server version for the right syntax to use near 'group FROM GroupTable
WHERE user='testadmin'' at line 1: /protected_directory

[Sun Dec 19 16:34:16 2004] [error] mysql user testadmin not in group
table GroupTable: /protected_directory

---------------------------------------
Any thoughts on what the issue is?

0
jerzhere
12/19/2004 11:21:14 PM
comp.infosystems.servers.unix 3274 articles. 0 followers. Post Follow

2 Replies
376 Views

Similar Articles

[PageSpeed] 1

Thanks HansH!!!

So doing "'group'" got rid for the mysql error but still would not log
my on, log error log said the user was not in the group. So I renamed
the group table from "group" to "groups" and like magic it worked.
Thanks again for your help!!!

0
jerzhere
12/20/2004 1:06:48 AM
FYI - The fix was to rename the group table in mysql from "group" to
something else, like "groups". Works like a charm now. Thanks HansH for
the fix!!!

0
jerzhere
12/20/2004 1:11:19 AM
Reply: