Database Reference
In-Depth Information
hep Data Manipulation
This command will display all of those statements for which help is available from the
client. One of those SQL statements is SHOW DATABASES .
help SHOW DATABASES
This command shows how to retrieve the help information related to that SQL state-
ment. As you can see, there is plenty of useful information accessible within the client.
If you can't quite remember the syntax of an SQL statement, it's a quick way to re-
trieve the information.
The first help command provides help on using the mysql client. The second help com-
mand shows you a list of categories for help on major aspects of MySQL or MariaDB. In
that list, you will see one of the categories is called, Data Manipulation . These are SQL
statements related to inserting, updating, and deleting data. The third help command will
display all of those statements for which help is available from the client. One of those
SQL statements is SHOW DATABASES . The last help command shows how to retrieve
the help information related to that SQL statement. As you can see, there is plenty of use-
ful information accessible within the client. If you can't quite remember the syntax of an
SQL statement, it's a quick way to retrieve the information.
A minor but sometimes useful tip is included in the third line of the opening results: to
cancel anSQL statement once you've started typing it, enter \c and press Enter without a
closing semicolon. It will clear whatever you have been entering, even on previous lines,
from the buffer of the mysql client, and return you to the mysql> prompt.
The very last line, the mysql> , is known as the prompt . It's prompting you to enter a
command, and is where you'll operate during most of this topic. If you press Enter
without finishing acommand, the prompt will change to -> to indicate that the client
hasn't yet sent the SQL statement to the server. On MariaDB, the default prompt is differ-
ent. It shows MariaDB [(none)]>> to start. When you later set the default database
to be used, the none will be changed to the name of the current default database.
Incidentally, it is possible to change the prompt to something else. To do so, enter the cli-
ent command prompt followed by the text you want to display for the prompt. There are a
few special settings (e.g., \d for default database). Here's how you might change the
prompt:
prompt SQL Command \d>\_
And here's how the prompt will look after you run the preceding command to change it:
Search WWH ::




Custom Search