Go Back   Web Server Hosting Forum by BODHost > Support > MySQL Issues.
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-07, 12:26
BOD Member
 
Join Date: Nov 2005
Posts: 131
Default MySQL with Apache

<a href="http://www.bodhosting.com/" target="_blank" title="SQL" style="color:#000000;text-decoration:none"><h1>MySQL with Apache</h1></a>

To authenticate users from MySQL database as well as write log files into MySQL table -

> Change Apache Logging format to make it readable by MySQL, this should be inserted in the Apache configuration file

LogFormat \
"\"%h\",%{%Y%m%d%H%M%S}t,%>s,\"%b\",\"%{Conten t-Type}o\", \
\"%U\",\"%{Referer}i\",\"%{User-Agent}i\""

> In order to load a log file in the above format in MySQL, please make use of the following statement -

LOAD DATA INFILE '/local/access_log' INTO TABLE tbl_name
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'

> A table which is name should be created in order to have columns that connect to the log format line writes to the log file.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 23:31.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.