Database Reference
In-Depth Information
Figure 5.6
The cookie table viewed in the graphical tools.
the graphical tools, connect to the mysqlfast database and run the query again. Figure 5.6
shows the results which compared with Figure 5.5 are identical.
Directly Inserting Data
Another way that we can insert data into tables is by using the MySQL command LOAD
DATA. This file loads data into a specified table from a text file. The basic format is as fol-
lows:
LOAD DATA INFILE 'filename'
INTO TABLE tablename (Column1, Column2, …)
Filename is the name of the text file with the data that you want to import. Tablename is
the table to insert the data into. The columns are the columns that you want to insert, in the
order that they appear within your text file. For example, the following is a heavily edited
section of a weblog file:
ID,DateCreated,Browser,IPNumber,CookierID,WebPageID,ReferringPage
1,2002-01-01,Mozilla/4.0,192.168.1.10,2,1,Typed
2,2002-01-01,Mozilla/4.0,192.168.1.10,2,2,http://minbar.homeip.net/
3,2002-01-01,Mozilla/4.0,192.168.1.10,2,3,http://www.google.com
4,2002-01-01,Mozilla/4.0,192.168.1.10,2,1,http://www.easyrew.com
5,2002-01-01,Mozilla/4.0,192.168.1.10,2,1,http://www.kli.org
If we wanted to import that file into our log table, we would need to save the above as a
text file. Call the file log.sql and save it in:
C:\mysql\data\mysqlfast
Search WWH ::




Custom Search