Creating the Database

In this section, you will create and fill the database with the initial data load. You will put all the statements except the create database into a file, which you can use to reload the database later if necessary.

Listing 6.1 assumes that a MySQL server is installed and running on the target machine.

First, start the MySQL command line tool by typing this line:

% mysql 

This changes the prompt to mysql>.

Then create the database:

mysql> CREATE DATABASE sesi; 

Listing 6.1 creates the SESI database for Chapters 6 and 7. It drops and refreshes the tables with the data being transferred in from the sample text files.

Usage (from the command prompt):

%mysql < listing.6.1 

or

%mysql -t < listing.6.1 

The -t option sends ...

Get MySQL Building User Interfaces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.