April 2007
Intermediate to advanced
1032 pages
19h 28m
English
Each table that is created is stored in a database. During MySQL installation, 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.
MySQL stores information on databases in the catalog table called INFORMATION_SCHEMA.
Example 27.1: Show the names of all databases.
SELECT SCHEMA_NAMEFROM INFORMATION_SCHEMA.SCHEMATA
The result is:
SCHEMA_NAME------------------ ...
Read now
Unlock full access