| mod_auth_mysql is an Apache module used to authenticate users and authorize access through a MySQL database. This module manages authentication of users whose username, password, etc. are stored in their respective MySQL database. Gossimer, LLC supports mod_auth_mysql on its Linux Hosting Servers.
A .htaccess file needs to be uploaded or created under the directory for which you wish to set authenticated access.
| Auth Directive |
Use |
| AuthMySQLUser |
The userid to be used to access MySQL |
| AuthMySQLPassword |
The password for the userid specified in AuthMySQLUser |
| AuthMySQLDB |
The name of the MySQL database containing the authorization information |
| AuthMySQLUserTable |
The name of the MySQL table in AuthMySQLDB which contains the userids and passwords |
| AuthMySQLNameField |
The name of the column in AuthMySQLUserTable which contains the userids to be authenticated |
| AuthMySQLPasswordField |
The name of the column in AuthMySQLUserTable which contains the passwords |
| AuthMySQLPwEncryption |
The encryption type used for the passwords in AuthMySQLPasswordField |
| AuthMySQLKeepAlive |
Indicates whether to keep the connection to MySQL open or close it after each request |
| AuthMySQLAuthoritative |
Used to indicate if other modules should be called when mod_auth_mysql is not able to authorize the user |
| AuthMySQLNoPasswd |
No password is required for this resource |
| AuthMySQLEnable |
Whether or not mod_auth_mysql should attempt to authorize the user |
| AuthMySQLUserCondition |
Additional conditions to be placed in the WHERE clause when retrieving user information |
| AuthMySQLGroupTable |
Contains the name of the table with the group information when authorizing by groups (Apache option require group) |
| AuthMySQLGroupField |
Contains the name of the column containing the group information when Apache group authorization is required |
| AuthMySQLGroupCondition |
Additional conditions to be placed in the WHERE clause when retrieving group information |
| AuthMySQLCharacterSet |
Used to override the default character set for the connection |
| AuthMySQLSaltField |
Contains information on the salt field to be used for crypt and aes encryption methods |
Example of a .htaccess file using mod_auth_mysql
AuthName “Your Protected Area”
AuthType Basic
AuthBasicAuthoritative Off
AuthMySQLEnable On
AuthMySQLUser <userid>
AuthMySQLPassword <password>
AuthMySQLDB <database name>
AuthMySQLUserTable <user table>
AuthMySQLPasswordField <password field name>
AuthMySQLPwEncryption <encryption method>
AuthMySQLAuthoritative On
AuthMySQLGroupTable <group table>
AuthMySQLGroupField <group field name>
Click here for more details about each directive and its usage >> |
Tags: Access Mysql, Apache Group, Authentication, Default Character, Hosting Servers, Htaccess File, Linux, Microsoft, Mysql Database, Mysql Table, Passwords, User Information