Figure 8.9 The finished import file.
Now that you have your import file, the battle is half over (or half started, depending on your point of
view). The second part is to load the data into the MySQL server. This is a pretty simple and
straightforward process. The first step is to gain access to the MySQL server. You can do this one of
two ways: you can use a Graphical User Interface (GUI) or a Telnet session. For this session, You will
use the Telnet session because this will give you the most practice. Because the import file is located
on your machine and not your MySQL server (I'm assuming you are using two different machines), you
will import the file using the LOAD DATA LOCAL INFILE statement. If your MySQL server and
personal machine are one in the same, you can still follow along. You won't have use Telnet, and you
won't have to use the LOCAL option in your LOAD DATA statement. Everything else should be the same.
- Open a Telnet session. The easiest way to do this is from a DOS prompt or
command line. Click Start, Run, and then type the following on the command line:
2. telnet 10.1.1.50 (use the name or IP of the machine that is running
MySQL)
This should start a Telnet session connecting you to your MySQL machine (see Figure
8.10).
Figure 8.10 A Telnet session.
- Enter your UNIX/Linux username and password. After you get to a command line,
change to the mysql directory and start the MySQL Monitor. - cd /usr/local/mysql
- bin/mysql –p Meet_A_Geek
This command will start you in the Meet_A_Geek database after you correctly enter the
root password. - After the MySQL monitor is started, issue the following command:
- DESCRIBE Orders;
If you created the database from the CD-ROM, the output should be similar to that shown
in Figure 8.11.