Oracle 5.0 Reference Manual page 297

Table of Contents

Advertisement

single backslashes. For example,
value. The following example shows how to define a prompt within an option file to include the
current time in
[mysql]
prompt="\\r:\\m:\\s> "
• Set the prompt interactively. You can change your prompt interactively by using the
command. For example:
mysql>
prompt (\u@\h) [\d]>\_
PROMPT set to '(\u@\h) [\d]>\_'
(user@host) [database]>
(user@host) [database]> prompt
Returning to default PROMPT of mysql>
mysql>
4.5.1.3.
Logging
mysql
On Unix, the
is named
.mysql_history
MYSQL_HISTFILE
How Logging Occurs
Statement logging occurs as follows:
• Statements are logged only when executed interactively. Statements are noninteractive, for example,
when read from a file or a pipe. It is also possible to suppress statement logging by using the
[265]
batch
logs each nonempty statement line individually.
mysql
• If a statement spans multiple lines (not including the terminating delimiter),
lines to form the complete statement, maps newlines to spaces, and logs the result, plus a delimiter.
Consequently, an input statement that spans multiple lines can be logged twice. Consider this input:
mysql>
SELECT
->
'Today is'
->
,
->
CONCAT()
->
;
In this case,
It also logs the complete statement, after mapping
SELECT 'Today is' ,
SELECT
'Today is'
,
CURDATE()
;
SELECT 'Today is' , CURDATE();
Controlling the History File
The
.mysql_history
information might be written to it, such as the text of SQL statements that contain passwords. See
Section 6.1.2.1, "End-User Guidelines for Password
If you do not want to maintain a history file, first remove
of the following techniques to prevent it from being created again:
— The MySQL Command-Line Tool
mysql
format:
HH:MM:SS>
client logs statements executed interactively to a history file. By default, this file
mysql
in your home directory. To specify a different file, set the value of the
environment variable.
or
[266]
--execute
logs the "SELECT", "'Today is'", ",", "CONCAT()", and ";" lines as it reads them.
mysql
CURDATE(), plus a delimiter. Thus, these lines appear in logged output:
file should be protected with a restrictive access mode because sensitive
is interpreted as a space rather than as the current seconds
\s
option.
SELECT\n'Today is'\n,\nCURDATE()
Security".
.mysql_history
277
(or \R)
prompt
--
concatenates the
mysql
to
if it exists. Then use either

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents