Description: Cherokee is a flexible, very fast, lightweight Web server. It is implemented entirely in C, and has no dependencies beyond a standard C library. It is embeddable and extensible with plug-ins. It supports on-the-fly configuration by reading files or strings, TLS/SSL (via GNUTLS or OpenSSL), virtual hosts, authentication, cache friendly features, PHP, custom error management, and much more.
Keywords: cherokee web server httpd http

## Index → Modules → Validators

### Validator: Mysql

The MySQL validator allows you to authenticate a user against a MySQL database.

Parameters
Parameter | Description
--- | ---
host | Optional. The server that is running the MySQL database server. Default: localhost.
port | Optional. The port that MySQL is listening on. Default: 3306.
unix_socket | Optional. A Unix socket.
user | The MySQL user to authenticate as.
passwd | The MySQL user password to use.
database | Required. The MySQL database to select upon connection.
query | Required. The query to execute to authenticate the HTTP user.
hash | Optional. What the passwords in the database table are hashed with. Valid options are sha1 md5 or none. Default: none.

The `query` parameter is given an argument `$\{user}` so you can query against it.

Sample query

        SELECT password FROM auth_users WHERE username = '${user}'

The query must return one row with one column as the password. The name of the column does not matter.

#### Compatibility

This validator is compatible with both basic and digest schemes.