content_image/688874.jpg
not to put an option in the [client]  group unless it is recognized by all  client programs that you use. Programs that do not understand the option quit after displaying an error message if you try to run them. 

List more general option groups first and more specific groups later. For example, a [client]  group is more general because it is read by all client programs, whereas a [mysqldump]  group is read only by mysqldump . Options specified later override options specified earlier, so putting the option groups in the order [client] , [mysqldump]  enables mysqldump -specific options to override [client]  options. 

Here is a typical global option file: 

[client] port=3306 socket=/tmp/mysql.sock [mysqld] port=3306 socket=/tmp/mysql.sock key_buffer_size=16M max_allowed_packet=128M [mysqldump] quick 

Here is a typical user option file: 

[client] # The following password is sent to all standard MySQL clients password="my password" [mysql] no-auto-rehash connect_timeout=2 

To create option groups to be read only by mysqld  servers from specific MySQL release series, use groups with names of [mysqld-5.7] , [mysqld-8.0] , and so forth. The following group indicates that the sql_mode  setting should be used only by MySQL servers with 8.0.x version numbers: 

## Option File Inclusions 

[mysqld-8.0] sql_mode=TRADITIONAL 

It is possible to use !include  directives in option files to include other option files and !includedir  to search specific directories for option files. For example, to include the /home/mydir/myopt.cnf  file, use the following directive: 

!include /home/mydir/myopt.cnf 

To search the /home/mydir  directory and read option files found there, use this directive: 

!includedir /home/mydir 

MySQL makes no guarantee about the order in which option files in the directory are read. 

<img src='content_image/688874.jpg'>

## Note 

Any files to be found and included using the !includedir  directive on Unix operating systems must  have file names ending in .cnf . On Windows, this directive checks for files with the .ini  or .cnf  extension. 

Write the contents of an included option file like any other option file. That is, it should contain groups of options, each preceded by a [ group ]  line that indicates the program to which the options apply. 

