Database Reference
In-Depth Information
Remember, you must always USE a database before you can access any
data in it.
Learning About Databases and Tables
But what if you don't know the names of the available databases? And for that
matter, how are clients like MySQL Workbench able to display a list of avail-
able databases?
Information about databases, tables, columns, users, privileges, and more is
stored within databases and tables themselves (yes, MariaDB uses MariaDB
to store this information). But these internal tables are generally not accessed
directly. Instead, the MariaDB SHOW command can be used to display this
information (information that MariaDB then extracts from those internal
tables). Look at the following example:
Input
SHOW DATABASES;
Output
+--------------------+
| Database |
+--------------------+
| information_schema |
| crashcourse |
| mysql |
| forta |
| coldfusion |
| flex |
| test |
+--------------------+
Analysis
SHOW DATABASES; returns a list of available databases. Included in this
list might be databases used by MariaDB internally (such as mysql and
information_schema in this example). Of course, your own list of databases
might not look like those shown here.
To obtain a list of tables within a database, use SHOW TABLES; , as seen here:
Input
SHOW TABLES;
 
 
Search WWH ::




Custom Search