mysql --max_allowed_packet=16M 

The first command specifies the value in bytes. The second specifies the value in megabytes. For variables that take a numeric value, the value can be given with a suffix of K , M , or G  to indicate a multiplier of 1024, 1024$^{2}$ or 1024$^{3}$. (For example, when used to set max_allowed_packet , the suffixes indicate units of kilobytes, megabytes, or gigabytes.) As of MySQL 8.0.14, a suffix can also be T , P , and E  to indicate a multiplier of 1024$^{4}$, 1024$^{5}$ or 1024$^{6}$. Suffix letters can be uppercase or lowercase. 

In an option file, variable settings are given without the leading dashes: 

[mysql] max_allowed_packet=16777216 

Or: 

[mysql] max_allowed_packet=16M 

If you like, underscores in an option name can be specified as dashes. The following option groups are equivalent. Both set the size of the server’s key buffer to 512MB: 

[mysqld] key_buffer_size=512M [mysqld] key-buffer-size=512M 

Suffixes for specifying a value multiplier can be used when setting a variable at program invocation time, but not to set the value with SET  at runtime. On the other hand, with SET , you can assign a variable’s value using an expression, which is not true when you set a variable at server startup. For example, the first of the following lines is legal at program invocation time, but the second is not: 

shell> mysql --max_allowed_packet=16M shell> mysql --max_allowed_packet=16*1024*1024 

Conversely, the second of the following lines is legal at runtime, but the first is not: 

mysql> SET GLOBAL max_allowed_packet=16M; mysql> SET GLOBAL max_allowed_packet=16*1024*1024; 

## 4.2.2.6 Option Defaults, Options Expecting Values, and the = Sign 

By convention, long forms of options that assign a value are written with an equals ( = ) sign, like this: 

mysql --host=tonfisk --user=jon 

For options that require a value (that is, not having a default value), the equal sign is not required, and so the following is also valid: 

mysql --host tonfisk --user jon 

In both cases, the mysql  client attempts to connect to a MySQL server running on the host named “tonfisk”  using an account with the user name “jon” . 

Due to this behavior, problems can occasionally arise when no value is provided for an option that expects one. Consider the following example, where a user connects to a MySQL server running on host tonfisk as user jon : 

shell> mysql --host 85.224.35.45 --user jon Welcome to the MySQL monitor. Commands end with ; or \g. 

