![]() ![]() |
||||||||||||||||
![]() ![]() ![]() ![]() |
||||||||||||||||
![]() |
![]() 4.15.4 Fichier d'optionsMySQL 3.22 can read default startup options for the server and for clients from option files. MySQL reads default options from the following files on Unix:
MySQL reads default options from the following files on Win32:
Note that you on Win32 should specify all paths with MySQL tries to read option files in the order listed above. If multiple option files exist, an option specified in a file read later takes precedence over the same option specified in a file read earlier. Options specified on the command line take precedence over options specified in any option file. Some options can be specified using environment variables. Options specified on the command line or in option files take precedence over environment variable values.
The following programs support option files:
You can use option files to specify any long option that a program supports!
Run the program with An option file can contain lines of the following forms:
The Note that for options and values, all leading and trailing blanks are automatically deleted. You may use the escape sequences `\b', `\t', `\n', `\r', `\\' and `\s' in your value string (`\s' == blank). Here is a typical global option file: [client] port=3306 socket=/tmp/mysql.sock [mysqld] port=3306 socket=/tmp/mysql.sock set-variable = key_buffer=16M set-variable = max_allowed_packet=1M [mysqldump] quick Here is typical user option file: [client] # The following password will be sent to all standard MySQL clients password=my_password [mysql] no-auto-rehash
If you have a source distribution, you will find a sample configuration file
named `my-example.cnf' in the `support-files' directory. If you
have a binary distribution, look in the `DIR/share/mysql' directory,
where
To tell a MySQL program not to read any option files, specify
If you want to force the use of a specific config file, you can use the option
Note for developers: Option file handling is implemented simply by processing all matching options (i.e., options in the appropriate group) before any command line arguments. This works nicely for programs that use the last instance of an option that is specified multiple times. If you have an old program that handles multiply-specified options this way but doesn't read option files, you need add only two lines to give it that capability. Check the source code of any of the standard MySQL clients to see how to do this. |