Using Mysql With Apache - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

+--------+----+---------+
| fish
|
| mammal |
| mammal |
| mammal |
| bird
|
| bird
|
+--------+----+---------+
In this case (when the
AUTO_INCREMENT
any group. This happens even for
reused.
If the
AUTO_INCREMENT
using the index that begins with the
table contained indexes
animals
ignore the
PRIMARY KEY
sequence, not a sequence per
To start with an
TABLE, like this:
ALTER
mysql>
ALTER TABLE tbl AUTO_INCREMENT = 100;
More information about
• How to assign the
Syntax", and
• How
AUTO_INCREMENT
Section 5.1.7, "Server SQL
• How to use the
AUTO_INCREMENT
• Setting the
AUTO_INCREMENT
• Server-system variables related to
auto_increment_offset
Variables".

3.7. Using MySQL with Apache

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
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
The named table should be created to have columns that correspond to those that the
writes to the log file.

Using MySQL with Apache

1 | lax
|
1 | dog
|
2 | cat
|
3 | whale
|
1 | penguin |
2 | ostrich |
AUTO_INCREMENT
values are reused if you delete the row with the biggest
MyISAM
column is part of multiple indexes, MySQL will generate sequence values
PRIMARY KEY (grp, id)
for generating sequence values. As a result, the table would contain a single
grp
AUTO_INCREMENT
AUTO_INCREMENT
AUTO_INCREMENT
Section 13.1.4,
"ALTER TABLE
behaves depending on the
Modes".
LAST_INSERT_ID()
value:
Section 12.13, "Information
value to be used:
AUTO_INCREMENT
and replication:
[1449]) that can be used for replication:
column is part of a multiple-column index),
tables, for which
column, if there is one. For example, if the
AUTO_INCREMENT
value.
value other than 1, you can set that value with
is available here:
attribute to a column:
Syntax".
NO_AUTO_VALUE_ON_ZERO
[961]
function to find the row that contains the most recent
Functions".
Section 5.1.4, "Server System
Section 16.4.1.1, "Replication and
AUTO_INCREMENT (auto_increment_increment
tbl_name
222
AUTO_INCREMENT
values normally are not
AUTO_INCREMENT
and
(id), MySQL would
INDEX
CREATE TABLE
Section 13.1.10,
"CREATE TABLE
Variables".
AUTO_INCREMENT".
Section 5.1.4, "Server System
\
value in
or
[536]
SQL mode:
[1446]
and
line
LogFormat

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents