By convention, long forms of options that assign a value are
written with an equals (=) sign, like this:
shell> mysql --host=tonfisk --user=jon
Due to this behavior, problems can occasionally arise when no
value is provided for an option that expects one. Consider the
following example, where a user connects to a MySQL server
running on host tonfisk as user
jon:
shell>mysql --host 85.224.35.45 --user jonWelcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 4.1.25 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>SELECT CURRENT_USER();+----------------+ | CURRENT_USER() | +----------------+ | jon@% | +----------------+ 1 row in set (0.00 sec)
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
--log-error option has the
default value
,
where host_name.errhost_name is the name of the
host on which MySQL is running. Assume 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>
Similar issues can arise when specifying option values in option
files. For example, consider a my.cnf file
that contains the following:
[mysql] host user

User Comments
Add your own comment.