Oracle 5.0 Reference Manual page 296

Table of Contents

Advertisement

Option
Description
The server host
\h
The current delimiter (new in 5.0.25)
\l
Minutes of the current time
\m
A newline character
\n
The current month in three-letter format (Jan, Feb, ...)
\O
The current month in numeric format
\o
am/pm
\P
The current TCP/IP port or socket file
\p
The current time, in 24-hour military time (0–23)
\R
The current time, standard 12-hour time (1–12)
\r
Semicolon
\S
Seconds of the current time
\s
A tab character
\t
Your full
\U
Your user name
\u
The server version
\v
The current day of the week in three-letter format (Mon, Tue, ...)
\w
The current year, four digits
\Y
The current year, two digits
\y
A space
\_
A space (a space follows the backslash)
\
Single quote
\'
Double quote
\"
A literal "\" backslash character
\\
x, for any "x" not listed above
\x
You can set the prompt in several ways:
• Use an environment variable. You can set the
For example:
shell>
export MYSQL_PS1="(\u@\h) [\d]> "
• Use a command-line option. You can set the
mysql. For example:
shell>
mysql --prompt="(\u@\h) [\d]> "
(user@host) [database]>
• Use an option file. You can set the
such as
/etc/my.cnf
[mysql]
prompt=(\\u@\\h) [\\d]>\\_
In this example, note that the backslashes are doubled. If you set the prompt using the
option in an option file, it is advisable to double the backslashes when using the special prompt
options. There is some overlap in the set of permissible prompt options and the set of special escape
sequences that are recognized in option files. (The rules for escape sequences in option files are
listed in
Section 4.2.3.3, "Using Option
— The MySQL Command-Line Tool
mysql
user_name@host_name
option in the
prompt
or the
file in your home directory. For example:
.my.cnf
Files".) The overlap may cause you problems if you use
276
account name
environment variable to a prompt string.
MYSQL_PS1
[268]
option on the command line to
--prompt
group of any MySQL option file,
[mysql]
prompt

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents