MySQL Authentication in .htaccess

Not tried and tested by me (yet) but I am assured that this is the way to do do this…

AuthName "MySQL Authentication"
AuthType Basic

AuthMySQLHost localhost
AuthMySQLUser accesssecurity
AuthMySQLPassword DBPWD
AuthMySQLDB accesssecurity

AuthMySQLUserTable users
AuthMySQLNameField username
AuthMySQLPasswordField password
AuthMySQLPwEncryption none

AuthMySQLUserCondition "user_status=1"
AuthMySQLAuthoritative On
AuthMySQLEnable On

require valid-user

DirectoryIndex index.html

ErrorDocument 401 /errors/error_not_authenticated.html
ErrorDocument 403 /errors/error_forbidden.html
ErrorDocument 404 /errors/error_not_found.html
ErrorDocument 500 /errors/error_oops.html