4.2.2
This command invokes mysql without specifying any connection parameters explicitly: shell> mysql
Because there are no parameter options, the default values apply:- The default host name is localhost. On Unix, this has a special meaning, as described later.
- The default user name is ODBC on Windows or your Unix login name on Unix.
- No password is sent if neither -p nor –password is given.
- For mysql, the first nonoption argument is taken as the name of the default database. If there is no such option, mysql does not select a default database.
If you use a -p or –password option and specify the password value, there must be no space
between -p or –password= and the password following it.On some systems, the library routine that MySQL uses to prompt for a password automatically limits the password to eight characters.
It is possible to specify different default values to be used when you make a connection so that you need not enter them on the command line each time you invoke a client program. This can be done in a couple of ways:
You can specify connection parameters in the [client] section of an option file. The relevant section of the file might look like this:
[client]
host=host_name
user=user_name
password=your_passYou can specify some connection parameters using environment variables. The host can be specified for mysql using MYSQL_HOST. The MySQL user name can be specified using USER (this is for Windows only). The password can be specified using MYSQL_PWD, although this is insecure;
4.2.4
Option names are case sensitive. -v and -V are both legal and have different meanings. (They are the corresponding short forms of the –verbose and –version options.)
For a long option that takes a value, separate the option name and the value by an “=” sign. For a short option that takes a value, the option value can immediately follow the option letter, or there can be a space between: -hlocalhost and -h localhost are equivalent. An exception to this rule is the option for specifying your MySQL password. This option can be given in long form as –password=pass_val or as –password.
4.2.9
- Because mysql assumes that any string following –host on the command line is a host name, –host –user is interpreted as –host=–user, and the client attempts to connect to a MySQL server running on a host named “–user“