content_image/842508.jpg content_image/842509.jpg
• --write-binlog 

By default, binary logging by mysql_upgrade  is disabled. Invoke the program with --write-binlog  if you want its actions to be written to the binary log. 

When the server is running with global transaction identifiers (GTIDs) enabled ( gtid_mode=ON ), do not enable binary logging by mysql_upgrade . 

• --zstd-compression-level= level 

The compression level to use for connections to the server that use the zstd  compression algorithm. The permitted levels are from 1 to 22, with larger values indicating increasing levels of compression. The default zstd  compression level is 3. The compression level setting has no effect on connections that do not use zstd  compression. 

## 4.5 Client Programs 

## 4.5.1 mysql — The MySQL Command-Line Client 

For more information, see Section 4.2.8, “Connection Compression Control” . 

This option was added in MySQL 8.0.18. 

This section describes client programs that connect to the MySQL server. 

mysql  is a simple SQL shell with input line editing capabilities. It supports interactive and noninteractive use. When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), the result is presented in tab-separated format. The output format can be changed using command options. 

If you have problems due to insufficient memory for large result sets, use the --quick  option. This forces mysql  to retrieve results from the server a row at a time rather than retrieving the entire result set and buffering it in memory before displaying it. This is done by returning the result set using the mysql_use_result() C API function in the client/server library rather than mysql_store_result() . 

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

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

## Note 

Alternatively, MySQL Shell offers access to the X DevAPI. For details, see MySQL Shell 8.0. 

Using mysql  is very easy. Invoke it from the prompt of your command interpreter as follows: 

mysql db_name 

Or: 

mysql --user= user_name  --password db_name 

In this case, you’ll need to enter your password in response to the prompt that mysql  displays: 

Enter password: your_password 

Then type an SQL statement, end it with ; , \g , or \G  and press Enter. 

Typing Control+C  interrupts the current statement if there is one, or cancels any partial input line otherwise. 

You can execute SQL statements in a script file (batch file) like this: 

mysql db_name  < script.sql  > output.tab 

