Using USE to select a database

We generally want to be connected to a specific database when we use the command-line client. To use a database, we either specify it on the command line when launching the client as shown in the previous section, or we use the USE command to tell the client which database we want to talk to. The following example illustrates connecting to a database named test. Notice that the prompt changes to let us know the name of the database it is currently connected to.

MariaDB [(none)]> USE test; 
Reading table information for completion of table and column names 
You can turn off this feature to get a quicker startup with -A 

Database changed 
MariaDB [test]> 

If the database does not exist when we try to USE it, we will ...

Get Getting Started with MariaDB - Second 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.