Overview
- MySQLProgramPlatform relevance
- MySQL options are case sensitive! Sensitive!
- "-" And "_" in the components of the MySQL option name can be exchanged. Note that it does not refer to the long name or short name prefix "--", "-"
- MySQL has a variety of server and client programs
- MySQL programs have many options: Long Name "--", short name "-", and no prefix options.
- The long form of MySQL options requires "=" to indicate the connection options and values. The short form is not required. It can be directly separated from the value or by a blank space. Note that the password option "-P" must be followed directly.
- MySQL options are common: -- user, -- Host, -- password, -- Port, etc.
- MySQL options have default values: changed as needed
- The options and priorities of MySQL are as follows: Default Value, OS environment variable, option file, command line option, SET command, etc.
- In addition to the above priority, the MySQL option will overwrite the previously specified value. Special: The -- user option setting that appears for the first time in [mysqld] is always prioritized
- As long as the MySQL option is not confused with others, you can only specify the previous part without writing the full name.
- If the MySQL option starts with "-- loose-", the client will not exit even if the specified option name is incorrect, but it is only a warning.
- Various MySQL programs can use "-- help | -?" Option help: supported options, supported option file sequence, supported option file segments, and the first option
Connect to the MySQL server
- Application OS Path Problems
- Windows Default Value: -- Host = localhost -- user = ODBC -- Password = ''-- Port = 3306 no database is selected by default.
- UNIX default value: -- Host = localhost (which has different meanings than Windows. Even if -- Port = 3306 is specified, the socket file instead of the TCP/IP protocol is used by default, it must be specified as "127.0.0.1" or "name" of the host) -- user = ODBC -- Password = ''-- Port = 3306 by default, no database is selected.
Special options and prefix
- {-- Execute = |-e} "statementlist;" -- connect to the MySQL server, execute the SQL statement, and exit
- -- Loose-Prefix -- negligible (error) Options
- -- Maximum prefix -- for some parameters, you can specify the maximum value.
MySQL option File
- Option files can have multiple locations
- Windows: % WINDIR %/My. ini % WINDIR %/My. cnf c:/My. ini C:/My. CNF mysqlinstalldir/My. ini myinstalldir/My. CNF
- UNIX:/etc/My. CNF/etc/MySQL/My. CNF sysconfdir/My. CNF -- usually/etc/My. CNF $ mysql_dir/My. CNF ~ /. My. CNF
- MySQL can also control the option file by specifying the first parameter.
- -- Defaults-extra-files = # -- specify an additional option File
- -- Defaults-file = # -- specify to read only the specified option file and ignore other
- -- No-defaults -- do not read the option File
- Blank line -- ignored
- ; -- Single row comment
- # -- Line comment. The comment can start from the middle of the row until the end of the row.
- [Group_name] -- Option [section]. All the option settings belong to this section starting from this until the option file ends or another [section] is encountered. Generally, group_name is the name of the application.
- Option_name -- option without setting its value
- Option_name = value -- option for which a value needs to be set
- ! Include other option files -- include other option files, similar to -- defaults-extra-file: the role of the first option Parameter
- ! Directory of other option files in includedir -- specify to include other option files -- the extension must be ". CNF ",". ini "-- base Directory; however, the sequence of searching sub-option files is unpredictable. Similar to the -- defaults-extra-File Option 1 parameter
- The "=" Operator in option settings can be left blank. Note that the "=" operator in the command line settings cannot be left blank!
- The text value in the selection setting must be enclosed in single or double quotation marks when there are special characters. The string value is a C-type string that can be escaped. For OS path settings, because "\" is a Windows path delimiter and a MySQL escape character, you must use "\" or "/"
- "[Mysqld]" section is the option setting section of the general mysqld server.
- "[Mysqld-Main version. Next version]" section is a non-General Section for reading various mysqld Release versions
- The [client] section is a special section that can be recognized by common clients. Make sure that you do not set the options used by special applications in this section.
- The options under each section must be recognizable to each application! Otherwise, you are dead !!!!