Database Reference
In-Depth Information
User
Request
DBMS
User
Request
Data
bases
User
Request
User
Request
Figure 1.1
DBMS controls access to the underlying data.
data required to define any of the activities that MySQL has to perform. It stores details of
other databases, users and all other files that the system uses to store data. It itself is a col-
lection of data used for a specific purpose. This makes MySQL self-defining, in that the
tables that it stores are used to define other tables that it stores.
When you are creating your own sets of data, create these in another database. In this
topic we will be using the mysql database to look at specific system functions, but all of the
other data that we create will be stored in a database called mysqlfast . MySQL can easily
control more than one database, so to prevent your tables being confused with system data,
it is best to separate them by using different databases.
Tables
The database is a container to store your tables in. The table is a collection of data of a sim-
ilar type. For instance, you could store all of the accesses to a website in one table, called log .
You may have seen a log file such as the one shown in Figure 1.2 from an Apache webserver.
Figure 1.2 shows an excerpt from a log file. The file, called access.log , has a new line
added to it every time a request is made to the Apache server. The entire file could be
likened to a table within the database. All of the types of data that represent an access to the
webserver are stored within this one file, or table, which has a name (access.log). In the
same directory that this file is stored in is another file called errors.log . This file stores all of
the errors that the Apache server logs and is really another table.
MySQL could be used to store all of the log entries and all of the error messages gener-
ated by the webserver.
The original database programs allowed you to set up little more than a table. Modern
database systems are classed as relational, although there is much argument in the database
fraternity as to what is relational and what is not. We will not enter this debate in this topic.
However, the term relational is useful in describing systems such as MySQL as the DBMS
allows you to relate data in tables to data in other tables. In fact, some tables contain
Search WWH ::




Custom Search