MySQL
の使用This chapter describes how to use MySQL with some common programs.
In this chapter you will:
Contrib には、 MySQL データベースに登録しているユーザーで 認証が出来るようになるプログラムと、 ログを MySQL テーブルに書き込むプログラムが 含まれています。 「D Contributed Programs」節参照.
以下のように Apache の設定ファイルに記述すれば、 Apache のログのフォーマットを、MySQL に読みやすい物に変更できます:
LogFormat \ "\"%h\",%{%Y%m%d%H%M%S}t,%>s,\"%b\",\"%{Content-Type}o\", \ \"%U\",\"%{Referer}i\",\"%{User-Agent}i\""
こうすれば、MySQL で、以下のようにできます:
LOAD DATA INFILE '/local/access_log' INTO TABLE table_name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
You can compile the MySQL windows source with Borland C++ 5.02. (The windows source includes only projects for Microsoft VC++, for Borland C++ you have to do the project files yourself).
One known problem with Borland C++ is that it uses a different structure
alignment than VC++. This means that you will run into problems if you
try to use the default libmysql.dll
libraries (that was compiled
with VC++) with Borland C++. You can do one of the following to avoid
this problem.
mysql_init()
with NULL
as an argument, not a
pre-allocated MYSQL struct.
Go to the first, previous, next, last section, table of contents.