The prompt command supports a number of options that allow you to display the mysql prompt in various ways. : MySQL « Command MySQL « SQL / MySQL






The prompt command supports a number of options that allow you to display the mysql prompt in various ways.

       

Option               Description
\                    Space (A space follows the backslash.)
\_                   Space
\\                   Backslash
\c                   A counter that increments by one for each statement that you execute (This option is not the same as the mysql clear (\c) command. The \c option shown here is specifically used as a switch for the prompt command.)
\d                   Current database
\D                   Current date
\h                   Server host
\m                   Minutes from current time
\n                   New line (no prompt)
\o                   Current month (numeric format)
\O                   Current month (three-letter format)
\p                   Current socket name, port number, or named pipe
\P                   a.m./p.m.
\r                   Current time (12-hour clock)
\R                   Current time (24-hour clock)
\s                   Seconds of the current time
\t                   Tab
\u                   Username
\U                   Username and hostname
\v                   Version of server
\w                   Current day of the week (three-letter format)
\y                   Current year (two-digit format)
\Y                   Current year (three-digit format)

   
    
    
    
    
    
    
  








Related examples in the same category

1.mysql Options
2.mysql Commands
3.Processing SQL Files with mysql
4.Change default-character-set for backup
5.Connect to the mysql database as the root user from the MySQL CLI
6.Connects the root account to the inventory database:
7.Connect to the MySQL database as root
8.Import a SQL-format dump file back into MySQL
9.If you dumped tables from a single database, you'll need to tell mysql which database to import them into
10.Verify whether the MySQL databases have been properly installed and configured.
11.Specify the user for mysql
12.To operate the mysql client utility in the context of the root user.
13.Specify a database when you start the mysql utility
14.To invoke mysql interactively from the command line, specify any necessary connection parameters after the command name
15.Provide a database name to select that database as the default database
16.Restoring a Single Database
17.Restoring Several Databases
18.Restoring a Database
19.Recreate the database in interactive mode:
20.Connect to the sampdb database on the local host and on cobra.snake.net:
21.Telling mysql to Read Queries from a File
22.MySQL Server and Included Administrative Tools
23.Common Options of the MySQL Client Tools
24.Producing HTML Output
25.Producing XML Output
26.Using the mysql Client to Export Data
27.Launching mysql with the option --silent:
28.XML Exporting with mysql
29.Sign into the MySQL server as root
30.The options part of the mysql command line might be empty
31.To determine the version of a program, use the --version option.
32.To determine the options supported by any MySQL program, invoke the program with the --help option.
33.Try out the various communication protocols
34.Find out which options will be taken from option files by mysql, use this command
35.Specifying Queries on the Command Line
36.To run multiple queries with the -e option, separate them with semicolons:
37.Getting Server Metadata
38.Produce output in formats other than tab-delimited
39.To connect to a server running on some other machine, it's necessary to specify the hostname using an -h option.
40.In many cases, a given option has both a long and a short form.
41.Connect with the same options as the previous example, but using the corresponding short option forms:
42.Generating HTML Tables