Oracle 5.0 Reference Manual page 262

Table of Contents

Advertisement

shell>
mysql --host --user jon
ERROR 2005 (HY000): Unknown MySQL server host '--user' (1)
Because
assumes that any string following
mysql
name,
[231]
--host
--user
attempts to connect to a MySQL server running on a host named "--user".
Options having default values always require an equal sign when assigning a value; failing to do so
causes an error. For example, the MySQL server
host_name.err, where
that you are running MySQL on a computer whose host name is "tonfisk", and consider the following
invocation of mysqld_safe:
shell>
mysqld_safe &
[1] 11699
shell> 080112 12:53:40 mysqld_safe Logging to '/usr/local/mysql/var/tonfisk.err'.
080112 12:53:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
shell>
After shutting down the server, restart it as follows:
shell>
mysqld_safe --log-error &
[1] 11699
shell> 080112 12:53:40 mysqld_safe Logging to '/usr/local/mysql/var/tonfisk.err'.
080112 12:53:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
shell>
The result is the same, since
line, and it supplies its own default value. (The
the background; it is ignored by MySQL itself.) Now suppose that you wish to log errors to a file named
my-errors.err. You might try starting the server with
have the intended effect, as shown here:
shell>
mysqld_safe --log-error my-errors &
[1] 31357
shell> 080111 22:53:31 mysqld_safe Logging to '/usr/local/mysql/var/tonfisk.err'.
080111 22:53:32 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
080111 22:53:34 mysqld_safe mysqld from pid file /usr/local/mysql/var/tonfisk.pid ended
[1]+
Done
The server attempted to start using
then shut down. Examining the last few lines of this file shows the reason:
shell>
tail /usr/local/mysql/var/tonfisk.err
080111 22:53:32
InnoDB: Started; log sequence number 0 46409
/usr/local/mysql/libexec/mysqld: Too many arguments (first extra is 'my-errors').
Use --verbose --help to get a list of available options
080111 22:53:32
[ERROR] Aborting
080111 22:53:32
InnoDB: Starting shutdown...
080111 22:53:34
InnoDB: Shutdown completed; log sequence number 0 46409
080111 22:53:34 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
080111 22:53:34 mysqld_safe mysqld from pid file /usr/local/mysql/var/tonfisk.pid ended
Because the
--log-error
assign a different value to it, as shown here:
shell>
mysqld_safe --log-error=my-errors &
[1] 31437
shell> 080111 22:54:15 mysqld_safe Logging to '/usr/local/mysql/var/my-errors.err'.
080111 22:54:15 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
shell>
Now the server has been started successfully, and is logging errors to the file
var/my-errors.err.
Specifying Program Options
[232]
is interpreted as
is the name of the host on which MySQL is running. Assume
host_name
[247]
--log-error
&
./mysqld_safe --log-error my-errors
/usr/local/mysql/var/tonfisk.err
[247]
option supplies a default value, you must use an equal sign to
242
[231]
on the command line is a host
--host
[231], and the client
--host=--user
[411]
option has the default value
--log-error
is not followed by anything else on the command
character tells the operating system to run MySQL in
--log-error
my-errors, but this does not
as the error log, but
/usr/local/mysql/

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents