Let's understand how MySQL command line options affect option file processing -
Many MySQL programs that support option files handle the following options. Because these options affect option file processing, they must be provided on the command line rather than in an options file. In order for it to work properly, each option must be provided before the other options, with the exceptions mentioned below -
−−print−defaults should be used immediately after −−defaults−file, −−defaults−extra−file, or −−loginpath.
On Windows, if server startup is done with the --defaults-file and --install options , you must first --install.
--defaults-extra-file=file_name
On Unix, read the above line in the options file after the global options file, but make sure it comes before the user options file and before the login path file on all platforms.
--login-path=name
It helps to read options from the specified login path in the .mylogin.cnf login path file. Login Path is a group of options that specify the correct MySQL server that must be connected to and the account that must authenticate.
To create or modify a login path file, you must use the mysql_config_editor utility.
mysql --login-path=mypath
By default, the mysql client reads the [client] and [mysql] option groups. For the above command, mysql reads [client] and [mysql] from the other option files, and [client], [mysql] and [mypath] will be read from the login path file.
The client program reads the login path file even if the --no-defaults option is used. To specify an alternate login path file name, the MYSQL_TEST_LOGIN_FILE environment variable must be set.
--print-defaults
It prints the program name and all options taken from the options file. Password value is masked.
The above is the detailed content of MySQL command line options that affect option file processing. For more information, please follow other related articles on the PHP Chinese website!