Chapter 22. Creating Databases

Introduction

Each table that is created is stored in a database. During the installation of MySQL, two databases are created automatically and used to store the catalog tables. We do not recommend adding your own tables to these databases. It is better to create new databases for this by using the CREATE DATABASE statement. Section 4.4 contains an example of this statement. In this relatively short chapter, we deal with this statement at great length.

Portability

Creating and dropping databases is an area in which huge differences between the SQL products exist. Because MySQL is supplied on the CD-ROM, we explain how this product treats this topic.

Databases and the Catalog

In MySQL, databases are stored in the catalog ...

Get Introduction to SQL: Mastering the Relational Database Language, Fourth Edition/20th Anniversary Edition 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.