Database Reference
In-Depth Information
As explained in Chapter 2, “Introducing MariaDB,” all this information can be
passed to the
mysql
command line utility, or entered into the server connec-
tion screen in MySQL Workbench.
Note
Using Other Clients If you are using a client other than the ones mentioned here, you
still need to provide this information to connect to MariaDB.
After you are connected, you have access to whatever databases and tables your
login name has access to. (Logins, access control, and security are revisited in
Chapter 28, “Managing Security.”)
When you first connect to MariaDB, you do not have any databases open
for use. Before you can perform any database operations, you need to select a
database. To do this you use the
USE
keyword.
New Term
Keyword A reserved word that is part of the MariaDB SQL language. Never name a
table or column using a keyword. Appendix D, “MariaDB Reserved Words,” lists the
MariaDB keywords.
For example, to use the
crashcourse
database you would enter the
following:
▼
Input
USE crashcourse;
▼
Output
Database changed
▼
Analysis
The
USE
statement does not return any results. Depending on the client used,
some form of notification might be displayed. For example, the
Database
changed
message shown here is displayed by the
mysql
command line utility
upon successful database selection.
Tip
Preselecting a Database If you are using the
mysql
command line tool, you can pre-
select a database by typing its name after
mysql
when running the tool.