|
Home > Archive > Web Servers on Unix and Linux > December 2004 > Apache2 + MySQL Authentication = MySQL Syntax Error
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Apache2 + MySQL Authentication = MySQL Syntax Error
|
|
| jerzhere 2004-12-19, 5:47 pm |
| 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?
| |
| jerzhere 2004-12-19, 8:46 pm |
| 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!!!
| |
| jerzhere 2004-12-19, 8:46 pm |
| 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!!!
|
|
|
|
|