- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
MySQL Command-Line Options that Affect Option-File Handling
Let us understand how MySQL command line options affect option file handling −
Many of the MySQL programs which support option files handle the below options. Since these options affect option-file handling, they must be provided on the command line and not in an option ile. For it to work properly, each of these options must be provided before other options, with the below mentioned exceptions −
−−print−defaults should be used immediately after −−defaults−file, −−defaults−extra−file, or −−loginpath.
On Windows, if the server startup is done with the --defaults-file and --install options, --install must be first.
On Unix, read the above line in option file after the global option file but ensure that it is before the user option file on all platforms before the login path file.
It helps read the options from the named login path in the .mylogin.cnf login path file. A ‘login path’ is an option group that contains options which specifies the correct MySQL server that has to be connected to and which account has to be authenticated as.
To create or modify a login path file, the mysql_config_editor utility has to be used.
By default, the mysql client reads the [client] and [mysql] option groups. For the above command, mysql reads [client] and [mysql] from other option files, and [client], [mysql], and [mypath] will read from the login path file.
Client programs read 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 has to be set.
It prints the program name and all options which it gets from option files. Password values are masked.
- Related Articles
- Using Options on the Command Line for MySQL programs?
- Python Parser for command line options
- C-style parser for command line options in Python
- MySQL Option Defaults, Options Expecting Values, and the = Sign
- Factors that affect the value of a stock options contract
- Command Options for Connecting to the MySQL Server
- Connecting to the MySQL Server Using Command Options
- The MySQL Command-Line Client
- What are some frequently used mysqlimport options while uploading the data into MySQL table through command line?
- MySQL command line client for Windows?
- Connect to MySQL database from command line
- How to read a file from command line using Python?
- Connecting to MySQL database from the command line?
- How to open MySQL command line on Windows10?
- How to upgrade MySQL server from command line?