There are programs that let you authenticate your users from a MySQL database and also let you write your log files into a MySQL table.
You can change the Apache logging format to be easily readable by MySQL by putting the following into the Apache configuration file:
LogFormat \
"\"%h\",%{%Y%m%d%H%M%S}t,%>s,\"%b\",\"%{Content-Type}o\", \
\"%U\",\"%{Referer}i\",\"%{User-Agent}i\""
To load a log file in that format into MySQL, you can use a statement something like this:
LOAD DATA INFILE '/LOCAL/ACCESS_LOG' INTO TABLE TBL_NAME
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
The named table should be created to have columns that correspond to those that the 'LogFormat' line writes to the log file.
File: manual.info.tmp, Node: programs, Next: server-administration, Prev: tutorial, Up: Top
4 MySQL Programs ****************
Menu:
unix-signal-response:: Unix Signal Handling in MySQL
This chapter provides a brief overview of the MySQL command-line programs provided by Oracle Corporation. It also discusses the general syntax for specifying options when you run these programs. Most programs have options that are specific to their own operation, but the option syntax is similar for all of them. Finally, the chapter provides more detailed descriptions of individual programs, including which options they recognize.
File: manual.info.tmp, Node: programs-overview, Next: programs-using, Prev: programs, Up: programs